#include <stdio.h>

void main()
{
	int n,k,x,y;
	scanf("%d",&n);
	printf("\n");
	scanf("%d",&k);
	printf("\n");
	scanf("%d",&x);
	printf("\n");
	scanf("%d",&y);
	printf("\n");
	if(n<=k){
		printf("%d\n",(n*x));
	}
	else{
		printf("%d\n",((n-k)*y)+(k*x));
	}
}
