fun main(args: Array<String>) {
    abc044a()
}

fun abc044a() {
    val (n, k, x, y) = (1..4).map { readLine()!!.toInt() }

    val answer = if (n <= k) n * x else k * x + (n - k) * y

    println(answer)
}
