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