N = int(eval(input()))

K = int(eval(input()))

X = int(eval(input()))

Y = int(eval(input()))

if N<=K:

    c = X*N

else:

    c = X*K+Y*(N-K)

print(c)
N = int(eval(input()))

K = int(eval(input()))

X = int(eval(input()))

Y = int(eval(input()))

if N<=K:

    ans = X*N

else:

    ans = X*K

    ans += Y*(N-K)

print(ans)
N = int(eval(input()))
K = int(eval(input()))
X = int(eval(input()))
Y = int(eval(input()))
if N <= K:
    c = X * N
else:
    c = X * K + Y * (N - K)
print(c)

N = int(eval(input()))
K = int(eval(input()))
X = int(eval(input()))
Y = int(eval(input()))
if N <= K:
    ans = X * N
else:
    ans = X * K
    ans += Y * (N - K)
print(ans)

-    c = X * N +    ans = X * N -    c = X * K + Y * (N - K) -print(c) +    ans = X * K +    ans += Y * (N - K) +print(ans)