#include<stdio.h>
int main()
{
	int n,k,f,s;
	scanf("%d",&n);
	scanf("%d",&k);
	scanf("%d",&f);
	scanf("%d",&s);
	if(n<=k)
	{
		printf("%d\n",n*f);
	}
	else if(n>k)
	{
		printf("%d\n",(k*f)+(s*(n-k)));
			
			
		}
			
			return 0;
}