#import <Foundation/Foundation.h>
#include <stdio.h>

int buf;
NSInteger intinput(void){
    scanf("%d",&buf);
    NSInteger ret = buf;
    return ret;
}

void output(NSString *s,NSString *sep){
    NSFileHandle *fileHandle = [NSFileHandle fileHandleWithStandardOutput];
    [fileHandle writeData:[s dataUsingEncoding:NSUTF8StringEncoding]];
    [fileHandle writeData:[sep dataUsingEncoding:NSUTF8StringEncoding]];
    [fileHandle closeFile];
}

NSMutableArray* to_numarray(NSString *s){
    NSMutableArray *l = [NSMutableArray arrayWithArray:[s componentsSeparatedByString:@" "]];
    NSInteger buf = 0;
    for(int i=0;i<[l count];i++){
        buf = [[l objectAtIndex:i] integerValue];
        [l replaceObjectAtIndex:i withObject:[NSNumber numberWithInteger:buf]];
    }
    return l;
}

int main(int argc, const char * argv[]) {
    NSInteger N = intinput();
    NSInteger K = intinput();
    NSInteger X = intinput();
    NSInteger Y = intinput();
    NSInteger v = (N-K>=0)?(K*X+(N-K)*Y):N*X;

    NSString *result = [NSString stringWithFormat:@"%ld",v];
    output(result,@"\n");
    return 0;
}
