#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdio> 
using namespace std;
int main()
{
	int n,k,x,y,money;
	cin>>n>>k>>x>>y;
	if(n>k)
	money=k*x+(n-k)*y;
	else
	money=n*x;
	cout<<money; 
}