There is a hotel with the following accommodation fee:    * X yen (the currency of Japan) per night, for the first K nights   * Y yen per night, for the (K+1)-th and subsequent nights  Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee.
# -*- coding : utf-8 -*-

n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n <= k :
  print(x * n)
else:
  print(x*k + y * (x-k))
# -*- coding : utf-8 -*-

n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n <= k :
  print(x * n)
else:
  print(x*k + y * (n-k))
