a = int(eval(input()))

b = int(a/15)

print((800*a-200*b))
n = int(eval(input()))

print((n * 800 - (n // 15) * 200))
a = int(eval(input()))
b = int(a / 15)
print((800 * a - 200 * b))

n = int(eval(input()))
print((n * 800 - (n // 15) * 200))

-a = int(eval(input())) -b = int(a / 15) -print((800 * a - 200 * b)) +n = int(eval(input())) +print((n * 800 - (n // 15) * 200))