object Main {

  import java.util.Scanner

  def main(args: Array[String]): Unit = {
    val scanner = new Scanner(System.in)
    var str = scanner.next()
    var sum = 0
    val n = str.toInt

    str = scanner.next()
    val k = str.toInt
    str = scanner.next()
    val x = str.toInt
    str = scanner.next()
    val y = str.toInt
    if(k < n){
      sum = k * x + (n - k) * y
    } else {
      sum = k * x
    }

    println(sum)

  }
}