function Main(input) {
  input = input.split("\n");
var N = parseInt(input[0], 10);
var K = parseInt(input[1], 10);
var X = parseInt(input[2], 10);
var Y = parseInt(input[3], 10);

if( N <= K ){
console.log(N*X);
}else{
var Q = N - K;
console.log(K*X+Q*Y);
}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));