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

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

  if (N < K) {
    writeln(N * X);
  } else {
    writeln(K * X + (N - K) * Y);
  }
}
