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

using namespace std;
char flag[100];

int main()
{
	int n,k,x,y,money;
	cin>>n>>k>>x>>y;
	if(n>k){
		money=k*x+(n-k)*y;
	}
	else{
		money=x*n;	
	}
	cout<<money<<endl;
	
	return 0;
	
}