#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
    int N,K,X,Y,s=0;
    cin>>N>>K>>X>>Y;
    if(N<=K) s=N*X;
    else s=X*K+(N-K)*Y;
    cout<<s<<endl;
return 0;
}