x = int(eval(input()))

if x >= 2000:

    print((1))

else:

    c = x//100 + 1

    am = x%100

    for i in range(c):

        for j in range(c-i):

            for k in range(c-i-j):

                for l in range(c-i-j-k):

                    for m in range(c-i-j-l):

                        if am == i*5 + j*4 + k*3 + l*2 + m*1:

                            print((1))

                            exit()

    print((0))

y = int(eval(input()))

dp = [0]*99

dp.insert(0,1)

if y >= 2000:

    print((1))

else:

    for x in range(100,y+1):

        if dp[x-100] == 1 or dp[x-101] == 1 or dp[x-102] == 1 or dp[x-103] == 1 or dp[x-104] == 1 or dp[x-105] == 1:

            dp.append(1)

        else:

            dp.append(0)



    print((dp[y]))
x = int(eval(input()))
if x >= 2000:
    print((1))
else:
    c = x // 100 + 1
    am = x % 100
    for i in range(c):
        for j in range(c - i):
            for k in range(c - i - j):
                for l in range(c - i - j - k):
                    for m in range(c - i - j - l):
                        if am == i * 5 + j * 4 + k * 3 + l * 2 + m * 1:
                            print((1))
                            exit()
    print((0))

y = int(eval(input()))
dp = [0] * 99
dp.insert(0, 1)
if y >= 2000:
    print((1))
else:
    for x in range(100, y + 1):
        if (
            dp[x - 100] == 1
            or dp[x - 101] == 1
            or dp[x - 102] == 1
            or dp[x - 103] == 1
            or dp[x - 104] == 1
            or dp[x - 105] == 1
        ):
            dp.append(1)
        else:
            dp.append(0)
    print((dp[y]))

-x = int(eval(input())) -if x >= 2000: +y = int(eval(input())) +dp = [0] * 99 +dp.insert(0, 1) +if y >= 2000: -    c = x // 100 + 1 -    am = x % 100 -    for i in range(c): -        for j in range(c - i): -            for k in range(c - i - j): -                for l in range(c - i - j - k): -                    for m in range(c - i - j - l): -                        if am == i * 5 + j * 4 + k * 3 + l * 2 + m * 1: -                            print((1)) -                            exit() -    print((0)) +    for x in range(100, y + 1): +        if ( +            dp[x - 100] == 1 +            or dp[x - 101] == 1 +            or dp[x - 102] == 1 +            or dp[x - 103] == 1 +            or dp[x - 104] == 1 +            or dp[x - 105] == 1 +        ): +            dp.append(1) +        else: +            dp.append(0) +    print((dp[y]))