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