object Main {
  def main(args: Array[String]) = {
    val sc = new java.util.Scanner(System.in)
      val N, K, X, Y = sc.nextInt

      val answer = if(N > K) K * X + (N-K) * Y else N * X

      println(answer)
  }
}
