function main(input){
	input = input.split("\n");
	input=stn(input);
	sum=(input[2]*input[1])+(input[0]-input[1])*input[3];
	op(sum);
}
function op(a){
	console.log(a);
}
function stn(a){
	return a.map(function(x){return parseInt(x,10);});
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));