import std.algorithm,
       std.string,
       std.range,
       std.stdio,
       std.conv;

void main() {
    int N = readln.chomp.to!int,
        K = readln.chomp.to!int,
        X = readln.chomp.to!int,
        Y = readln.chomp.to!int;
  int ans;

  if (N <= K) {
    ans = N * X;
  } else {
    int cost1 = K * X,
        cost2 = (N - K) * Y;
    ans = cost1 + cost2;
  }

  writeln(ans);
}