#include <stdio.h>
int main(){
	int N,K,X,Y;
	int F;
	scanf("%d %d %d %d",&N,&K,&X,&Y);
	if(N < K){
		F = X*N ;
		printf("%d",F);
	}
	if(N > K){
		F = K*X+(N-K)*Y ;
		printf("%d",F);
	}



	return 0;
}



