#include<stdio.h>

int main()
{
	long long int n,k,m,p,t,r,l,result;
	scanf("%lld %lld %lld %lld", &n,&k,&m,&p);
	if(n>k) 
	{
		r=(k*m);
		t=(n-k);
		l=t*p;
		result=l+r;
		
		printf("%lld\n",result); 
	}
	else 
	{
		result= n*m;
		printf("%lld\n",result);
	}
	return 0;
}