l = [int(eval(input())) for _ in range(4)]

if l[1] >= l[0]:

  print((l[0]*l[2]))

else:

  print((l[1]*l[2] + (l[0]-l[1])*l[3]))
n,k,x,y = (int(eval(input())) for _ in range(4))

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

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

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