[<EntryPoint>]
let main argv =
    let rint () = stdin.ReadLine() |> int
    let n = rint ()
    let k = rint ()
    let a = rint ()
    let b = rint ()
    n * a - (b - a) * (max (n - k) 0)
    |> stdout.WriteLine
    0