import scala.io.StdIn

object Main extends App {

  val List(n, k, x, y) = (0 until 4).map(_ => StdIn.readLine().toLong).toList

  val k2 = if (n > k) n - k else n

  println(k2 * x + (n - k2) * y)

}