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