function Main(input) {
	const array = input.split("\n").map(c => parseInt(c));
	const n = array[0];
    const k = array[1];
    const x = array[2];
    const y = array[3];
    if ( n <= k ) {
      ans = x * n;
    } else {
      ans = x * k + y * ( n - k );
    }
  	console.log(ans);
}

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