n, k, x, y = [int(eval(input())) for i in range(4)]

sum = 0



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

    if t <= k:

        sum += x

    else:

        sum += y



print(sum)

n = int(eval(input()))

k = int(eval(input()))

x = int(eval(input()))

y = int(eval(input()))



if n <= k:

    ans = n * x

else:

    ans = k * x + (n-k) * y



print(ans)
n, k, x, y = [int(eval(input())) for i in range(4)]
sum = 0
for t in range(1, n + 1):
    if t <= k:
        sum += x
    else:
        sum += y
print(sum)

n = int(eval(input()))
k = int(eval(input()))
x = int(eval(input()))
y = int(eval(input()))
if n <= k:
    ans = n * x
else:
    ans = k * x + (n - k) * y
print(ans)

-n, k, x, y = [int(eval(input())) for i in range(4)] -sum = 0 -for t in range(1, n + 1): -    if t <= k: -        sum += x -    else: -        sum += y -print(sum) +n = int(eval(input())) +k = int(eval(input())) +x = int(eval(input())) +y = int(eval(input())) +if n <= k: +    ans = n * x +else: +    ans = k * x + (n - k) * y +print(ans)