function Main(input){
  input = input.split('\n').map(num => Number(num));
  var n = input[0];
  var k = input[1];
  var x = input[2];
  var y = input[3];

    var price = 0;

  if(n - k < 0) {
    price = n * x;
  } else {
    price = k * x + (n - k) * y;
  }

  console.log(price);


}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));