a = [int(eval(input())) for i in range(4)]

if a[0] <= a[1]:

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

else:

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

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

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

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