import numpy as np

from collections import Counter, defaultdict, deque



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 = 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)
import numpy as np
from collections import Counter, defaultdict, deque

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 = 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)

-import numpy as np -from collections import Counter, defaultdict, deque -