import java.util.*

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