#include<stdio.h>
int main()
{
    int N,K,X,Y,sum1,sum2,sum;
    scanf("%d %d %d %d",&N,&K,&X,&Y);
    if (N<=K){
        sum=N*X;
    }
    else if(N>K){
        sum1=(N-K)*Y;
        sum2=K*X;
        sum=sum1+sum2;
    }
    printf("%d\n",sum);

    return 0;

}
