# include <iostream>
# include <cstdio>
# include <cstring>
# include <iomanip>
# include <algorithm>
# include <cmath>
# include <cstdlib>
using namespace std;
int d[1005];
int main ()
{
	int n, k, x, y, money;
	cin >> n >> k >> x >> y;
	if (n <= k) money = n * x;
	else if (n > k) money = k * x + (n - k) * y;
	cout << money << endl; 
	return 0;
}