#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
	int n,k,x,y;
	cin>>n>>k>>x>>y;
	if(n>k)
	{
		m=k*x+(n-k)*y;
	}
	else
	{
		m=n*x;
	}
	cout<<m<<endl;
	return 0;
}