#include<stdio.h>
int main()
{
    long long int n,k,x,y,i,s1,t,s2;
    scanf("%lld%lld%lld%lld",&n,&k,&x,&y);
    if(n>k)
    {
        s1=k*x;
        s2=(n-k)*y;
        t=s1+s2;
        printf("%lld\n",t);
    }
    else if(n<=k)
    {
        s1=n*x;
        t=s1;
        printf("%lld\n",t);
    }
    return 0;
}
