object Main {
  def main(args: Array[String]) = {
      val list = io.Source.stdin.getLines().map{_.toInt}.toList
      val N = list(0)
      val K = list(1)
      val X = list(2)
      val Y = list(3)

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

      println(answer)
  }
}
