import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;

void main()
{
	int n = to!int(chomp(readln()));
	int k = to!int(chomp(readln()));
	int x = to!int(chomp(readln()));
	int y = to!int(chomp(readln()));
	int cost = 0;
	if(n > k)
	{
		cost = k*x+(n-k)*y;
	}
	else
	{
		cost = n * x;
	}
	writeln(to!string(cost));
}

int[] stringText2IntArray(string text)
{
	return map!(to!int)(split(readln())).array;
}
