fun main(args: Array<String>){
    val N = readLine()!!.toInt()
    val t = readLine()!!.toInt()
    val e = readLine()!!.toInt()
    val r = readLine()!!.toInt()
    var a = 0

    for(i in 1..N){
        if(i > t){
            a += r
        }else{
            a += e
        }
    }
    println(a)
}
