import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt()
  val K = sc.nextInt()
  val X = sc.nextInt()
  val Y = sc.nextInt()

  val a = if (N > K) K else N
  val b = if (N > K) N - K else 0

  println(a * X + b * Y)
}
