#include<stdio.h>

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