import scala.io.StdIn

object Main extends App{
//  println("hello, world")
  val N = StdIn.readInt()
  val K = StdIn.readInt()
  val X = StdIn.readInt()
  val Y = StdIn.readInt()

  val fee = if(N > K) X * K + (N - K) * Y else X * N

  println(fee)


}
