import std.stdio, std.conv, std.string, std.math, std.regex, std.range, std.ascii, std.algorithm;

void main(){
	auto N = readln.chomp.to!int;
	auto K = readln.chomp.to!int;
	auto X = readln.chomp.to!int;
	auto Y = readln.chomp.to!int;
	if(N-K <= 0){
		writeln(N*X);
	}else{
		writeln(K*X + (N-K)*Y);
	}
}