x=int(eval(input()))

for i in range(1,100000):

  if 100*i<=x<=105*i:

    print((1))

    exit()

print((0))
x=int(eval(input()))

print((1 if x<=x//100*105 else 0))
x = int(eval(input()))
for i in range(1, 100000):
    if 100 * i <= x <= 105 * i:
        print((1))
        exit()
print((0))

x = int(eval(input()))
print((1 if x <= x // 100 * 105 else 0))

-for i in range(1, 100000): -    if 100 * i <= x <= 105 * i: -        print((1)) -        exit() -print((0)) +print((1 if x <= x // 100 * 105 else 0))