#include<cstdio>
#include<iostream>
#include<cmath>

using namespace std;

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

	return 0;
}
		