from collections import deque



def solve(X):

    if X >= 2000:

        return 1



    prices = list(range(100, 106))

    Q = deque([(0, 0)])

    while Q:

        i, pNow = Q.popleft()

        if i == 6:

            if pNow == X:

                return 1

        else:

            price = prices[i]

            for num in range(20):

                p2 = pNow + price*num

                if p2 > X: break

                Q.append((i+1, p2))



    return 0



X = int(eval(input()))



print((solve(X)))

X = int(eval(input()))



dp = [False] * (X+1)

dp[0] = True

for i in range(1, X+1):

    dp[i] = any(dp[i-(X+1)-105:i-(X+1)-99])



print((int(dp[X])))

from collections import deque


def solve(X):
    if X >= 2000:
        return 1
    prices = list(range(100, 106))
    Q = deque([(0, 0)])
    while Q:
        i, pNow = Q.popleft()
        if i == 6:
            if pNow == X:
                return 1
        else:
            price = prices[i]
            for num in range(20):
                p2 = pNow + price * num
                if p2 > X:
                    break
                Q.append((i + 1, p2))
    return 0


X = int(eval(input()))
print((solve(X)))

X = int(eval(input()))
dp = [False] * (X + 1)
dp[0] = True
for i in range(1, X + 1):
    dp[i] = any(dp[i - (X + 1) - 105 : i - (X + 1) - 99])
print((int(dp[X])))

-from collections import deque - - -def solve(X): -    if X >= 2000: -        return 1 -    prices = list(range(100, 106)) -    Q = deque([(0, 0)]) -    while Q: -        i, pNow = Q.popleft() -        if i == 6: -            if pNow == X: -                return 1 -        else: -            price = prices[i] -            for num in range(20): -                p2 = pNow + price * num -                if p2 > X: -                    break -                Q.append((i + 1, p2)) -    return 0 - - -print((solve(X))) +dp = [False] * (X + 1) +dp[0] = True +for i in range(1, X + 1): +    dp[i] = any(dp[i - (X + 1) - 105 : i - (X + 1) - 99]) +print((int(dp[X])))