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