n = int(eval(input()))

k = int(eval(input()))

x = int(eval(input()))

y = int(eval(input()))

price = 0

for i in range(1, n + 1):

  price += x if i <= k else y

print(price)

    
N = int(eval(input()))

K = int(eval(input()))

X = int(eval(input()))

Y = int(eval(input()))



val = 0

for i in range(N):

  val += X if i < K else Y

print(val)
n = int(eval(input()))
k = int(eval(input()))
x = int(eval(input()))
y = int(eval(input()))
price = 0
for i in range(1, n + 1):
    price += x if i <= k else y
print(price)

N = int(eval(input()))
K = int(eval(input()))
X = int(eval(input()))
Y = int(eval(input()))
val = 0
for i in range(N):
    val += X if i < K else Y
print(val)

-n = int(eval(input())) -k = int(eval(input())) -x = int(eval(input())) -y = int(eval(input())) -price = 0 -for i in range(1, n + 1): -    price += x if i <= k else y -print(price) +N = int(eval(input())) +K = int(eval(input())) +X = int(eval(input())) +Y = int(eval(input())) +val = 0 +for i in range(N): +    val += X if i < K else Y +print(val)