object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n, k, x, y = sc.nextInt

    val cost = if (n < k) n * x
    	else k * x + (n - k) * y

    println(cost)
  }
}