let n = read_int ()
let k = read_int ()
let x = read_int ()
let y = read_int ()

let () =
  if n > k then
    begin print_int @@ k * x + (n - k) * y; print_newline () end
  else
    begin print_int @@ n * x; print_newline () end