n = int(eval(input()))

k = int(eval(input()))

x = int(eval(input()))

y = int(eval(input()))

ans = 0

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

    if i <= k:

        ans += x

    else:

        ans += y

print(ans)
n = int(eval(input()))

k = int(eval(input()))

x = int(eval(input()))

y = int(eval(input()))

ans = 0

if n > k:

    print(((n - k) * y + k * x))

else:

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

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

-for i in range(1, n + 1): -    if i <= k: -        ans += x -    else: -        ans += y -print(ans) +if n > k: +    print(((n - k) * y + k * x)) +else: +    print((n * x))