import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val N = sc.nextInt()
    val K = sc.nextInt()
    val X = sc.nextInt()
    val Y = sc.nextInt()
    println(Math.min(K, N) * X + Math.max(0, N - K) * Y)
}