object Main{
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt();
    val k = sc.nextInt();
    val x = sc.nextInt();
    val y = sc.nextInt();

    if(n <= k) {
      println(n * x);
    }
    else {
      println(k * x + (n - k) * y);
    }
  }
}
