#include <stdio.h>
int main ()
{
    int n,k,x,y,s;
    scanf ("%d %d %d %d",&n,&k,&x,&y);
    if (n<=k)
    {
        s = n*x;
    }
    else
    {
        s = k*x + y*(n-k);
    }
    printf ("%d", s);
    return 0;
}
