#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{	
	int N,K,X,Y,sum=0;
	cin>>N>>K>>X>>Y;
	for(int i=1;i<=N;i++)
	{
		if(i<(K+1)){sum=i*X;}
		if(i>=(K+1)){sum=K*X+(i-K)*Y;}
	}
	cout<<sum<<endl; 
	return 0;
}
