n=int(eval(input()))

k=int(eval(input()))

x=int(eval(input()))

y=int(eval(input()))



if k<n:

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

else:

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

print((x*min(k,n)+y*max(n-k,0)))
n = int(eval(input()))
k = int(eval(input()))
x = int(eval(input()))
y = int(eval(input()))
if k < n:
    print((x * k + y * (n - k)))
else:
    print((x * n))

n, k, x, y = [int(eval(input())) for _ in range(4)]
print((x * min(k, n) + y * max(n - k, 0)))

-n = int(eval(input())) -k = int(eval(input())) -x = int(eval(input())) -y = int(eval(input())) -if k < n: -    print((x * k + y * (n - k))) -else: -    print((x * n)) +n, k, x, y = [int(eval(input())) for _ in range(4)] +print((x * min(k, n) + y * max(n - k, 0)))