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 res =
    if(n <= k) x * n
    else x * k + (n - k) * y

  println(res)

}
