  // A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit) https://atcoder.jp/contests/abc044/tasks/abc044_a

  import io.Source

  object Main extends App {
    val xs = Source.stdin.getLines()
    val n = xs.next()
    val k = xs.next()
    val x = xs.next()
    val y = xs.next()

    def solve(n: Int, k: Int, x: Int, y: Int): String = {
      if (n >= k) {
        (x * k + y * (n - k)).toString
      } else {
        (x * n).toString
      }
    }
  }
