#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main() 
{   
    int N,K,X,Y,m=0;
    cin>>N>>K>>X>>Y;
    if(N>=K)
    m=K*X+(N-K)*Y;
    else 
    m=N*X;
    cout<<m<<endl;
	return 0; 
}