import java.util.Scanner

object Main {
  def main(args:Array[String]):Unit = {
    val sc:Scanner = new Scanner(System.in)

    val n:Integer = sc.nextLine().toInt
    val k:Integer = sc.nextLine().toInt
    val x:Integer = sc.nextLine().toInt
    val y:Integer = sc.nextLine().toInt

    if (n > k) {
      println(x * k + y * (n - k))
    } else {
      println(x * n)
    }
  }
}