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.
a=int(input())
b=int(input())
c=int(input())
d=int(input())
x=0
for i in range(a):
  if i <= b:
    x += c
  else:
    x += d
print(x)
a=int(input())
b=int(input())
c=int(input())
d=int(input())
x=0
for i in range(a):
  if i < b:
    x += c
  else:
    x += d
print(x)