#import <stdio.h>
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
int main() {
    long n,k,x,y;
    scanf("%ld %ld %ld %ld",&n,&k,&x,&y);
    printf("%ld", MIN(n,k)*x + MAX(n-k,0)*y);
}
