extension String: CollectionType {} // splitを使うためのおまじない

let N: Int = Int(readLine()!)!
let K: Int = Int(readLine()!)!
let X: Int = Int(readLine()!)!
let Y: Int = Int(readLine()!)!
//let a: [Int] = readLine()!.split(" ").map { Int($0)! }
//print(a)
var ans: Int = X*min(N,K)
if N>K {
    ans+=(N-K)*Y
}
print(ans)