#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n,k,x,y;
    while(~scanf("%d %d %d %d",&n,&k,&x,&y))
    {

        if(n>k)
            printf("%d\n", x*k+(n-k)*y);
        else

            printf("%d\n", x*n);

    }

    return 0;
}
