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()
    val func = if (n <= k) x * n else x * k + y * (n - k)
    println(func)
}
