N = int(eval(input()))

K = int(eval(input()))

X = int(eval(input()))

Y = int(eval(input()))



if N <= K:

    print((N*X))

else:

    print((K*X + (N-K)*Y))

N = int(eval(input()))

K = int(eval(input()))

X = int(eval(input()))

Y = int(eval(input()))



if N <= K:

    print((N*X))

else:

    print((K*X+Y*(N-K)))

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

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

-    print((K * X + (N - K) * Y)) +    print((K * X + Y * (N - K)))