s = int(input()) n = 1 while s < 51: s = s + 5 n = n * 2 print(n)
d = int(input()) n = 0 s = 0 while s <= 365: s = s + d n = n + 5 print(n)
s = int(input()) n = 1 while s < 94: s = s + 8 n = n * 2 print(n)
s = int(input()) n = 1 while s <= 45: s = s + 4 n = n * 2 print(n)
s = int(input()) n = 3 while s <= 51: s = s + 7 n = n * 2 print(n)
s = int(input()) n = 1 while s > 43: s = s - 8 n = n * 2 print(n)
s = int(input()) n = 10 while s > 0: s = s - 15 n = n + 3 print(n)
s = int(input()) n = 105 while n > s: s = s + 3 n = n - 2 print(n)