#include<bits/stdc++.h>
using namespace std ;

int main()
{
	int  N , K , X , Y ,a = 0;
	cin >> N >> K >> X >> Y ;
	if ( N > K )
	{
		a = K * X + ( N - K ) * Y ;
	}
	else
	{
		a =	N * X ;
	}
	cout << a << endl ;
	return 0 ;
}