function Main(input) {
	input = input.trim();
	//input = input.trim().split(" ");
	//input = input.trim().split("\n");
	//input = input.trim().split(" ").map((a)=>Number(a));
	input = input.trim().split("\n").map((a)=>Number(a));
  var N = input[0];
  var K = input[1];
  var X = input[2];
  var Y	= input[3];
  console.log(X * Math.min(N,K) + Math.max(0,N - K) * Y);
}

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