import sys



x = int(eval(input()))

for i in range(x):

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

        print((1))

        sys.exit()



print((0))

x = int(input())

dp = [False] * (x + 106)

money_li = [100, 101, 102, 103, 104, 105]

dp[0] = True

for i in range(x + 1):

    if dp[i]:

        for money in money_li:

            dp[i + money] = True



print(1) if dp[x] else print(0)

import sys

x = int(eval(input()))
for i in range(x):
    if i * 100 <= x <= i * 105:
        print((1))
        sys.exit()
print((0))

x = int(input())
dp = [False] * (x + 106)
money_li = [100, 101, 102, 103, 104, 105]
dp[0] = True
for i in range(x + 1):
    if dp[i]:
        for money in money_li:
            dp[i + money] = True
print(1) if dp[x] else print(0)

-import sys - -x = int(eval(input())) -for i in range(x): -    if i * 100 <= x <= i * 105: -        print((1)) -        sys.exit() -print((0)) +x = int(input()) +dp = [False] * (x + 106) +money_li = [100, 101, 102, 103, 104, 105] +dp[0] = True +for i in range(x + 1): +    if dp[i]: +        for money in money_li: +            dp[i + money] = True +print(1) if dp[x] else print(0)