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