fun main(args: Array<String>) {
  var n = readLine()!!.toInt()
  var k = readLine()!!.toInt()
  var x = readLine()!!.toInt()
  var y = readLine()!!.toInt()
  if (n <= k) {
    println(x*n)
  } else {
    println(x*k+y*(n-k))
  }
}