#include<iostream>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<cstdio>
using namespace std;

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