CodeEff/ECCO huggingface dataset:
# Original solution
#!/usr/bin/env python3

def solve(x):
    if x >= 2000:
        return True
    memo = [True] + [False]*x

    def dp(k):
        if k == 0:
            return True
        elif k < 0:
            return False
        elif memo[k]:
            return True
        for i in range(100,106):
            if dp(k-i):
                return True
        
        return False
    
    for i in range(x):
        memo[i+1] = dp(i+1)
    return memo[x]



def main():
    X = int(eval(input()))
    print((int(solve(X))))
    return

if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3

def solve(x):
    if x >= 2000:
        return True
    memo = [True] + [False]*x

    def dp(k):
        if k == 0:
            return True
        for i in range(100,106):
            if k-i >= 0 and memo[k-i]:
                return True
        
        return False
    
    for i in range(x):
        memo[i+1] = dp(i+1)
    return memo[x]



def main():
    X = int(eval(input()))
    print((int(solve(X))))
    return

if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))

import sys
sys.setrecursionlimit(10 ** 9)

def dfs(x):
    ans = False
    if x == 0:
        return True
    elif x < 0:
        return False
    else:
        ans |= dfs(x - 100)
        ans |= dfs(x - 101)
        ans |= dfs(x - 102)
        ans |= dfs(x - 103)
        ans |= dfs(x - 104)
        ans |= dfs(x - 105)

    return ans
if dfs(N):
    print((1))
else:
    print((0))


# Optimized solution
N = int(eval(input()))

import sys
sys.setrecursionlimit(10 ** 9)

memo = [-1] * (N + 1)

def dfs(x):
    if x >= 0 and memo[x] != -1:
        return memo[x]
    ans = False
    if x == 0:
        memo[x] = 1
        return True
    elif x < 0:
        return False
    else:
        ans |= dfs(x - 100)
        ans |= dfs(x - 101)
        ans |= dfs(x - 102)
        ans |= dfs(x - 103)
        ans |= dfs(x - 104)
        ans |= dfs(x - 105)
    memo[x] = 1 if ans else 0
    return ans
if dfs(N):
    print((1))
else:
    print((0))
# Original solution
X = int(eval(input()))
c = 0
for i in range(int(X/105)+1):
    for j in range(int((X-105*i)/104)+1):
        for k in range(int((X-105*i-104*j)/103) +1):
            for l in range(int((X-105*i-104*j-103*k)/102) +1):
                for m in range(int((X-105*i-104*j-103*k-102*l)/101)+1):
                    if (X-105*i-104*j-103*k-102*l-101*m) % 100 == 0:
                        c = 1
                            
print(c)


# Optimized solution
X= int(eval(input()))
val = X // 100
diff = X % 100
if diff <= 5*val:
    print((1))
else:
    print((0))
# Original solution
x = int(eval(input()))

# 最大n個は買う必要がある
n = x // 100

# 最低m個買う必要がある
m = x // 105

ans = 0
# もし割り切れたら、OK
for i in range(100,106):
  if x % i == 0:
    ans = 1
    break

import itertools
shinamono = [100,101,102,103,104,105] * (n)
for i in range(m,n+1):
  if ans == 1:
    break
  a = itertools.combinations(shinamono, i)
  for j in a:
    if sum(j) == x:
      ans = 1
      break

print(ans)


# Optimized solution
x = int(eval(input()))

ans = 0
for i in range(1,100001):
  if 100 * i <= x and 105 * i >= x:
    ans = 1
    break

print(ans)
# Original solution
import itertools
X = int(eval(input()))
num = X//100
r = X % 100
li = [0, 1, 2, 3, 4, 5]
flag = False
for i in itertools.product(li, repeat=num):
    if sum(i) == r:
        flag = True
        break
print(('1' if flag else '0'))

# Optimized solution
X = int(eval(input()))
flag = False
for i in range(1, X+1):
    if 100*i <= X <= 105*i:
        flag = True
        break
print(('1' if flag else '0'))
# Original solution
x=int(eval(input()))
for i in range(1,100000):
  if 100*i<=x<=105*i:
    print((1))
    exit()
print((0))

# Optimized solution
x=int(eval(input()))
print((1 if x<=x//100*105 else 0))
# Original solution
import sys
x = int(eval(input()))


number = int(x/100)
xn = x-number*100
number = number+1

for i in range(0,number):
    for j in range(0,number-i):
        for k in  range (0,number-i-j):
            for l in range(0,number-i-j-k):
                for m in range(0,number-i-j-k-l):
                    for n in range(0,number-i-j-k-l-m):
                        if j*1+k*2+l*3+m*4+n*5==xn:
                            if i*100+j*101+k*102+l*103+m*104+n*105==x:
                                print((1))
                                sys.exit()
print((0))

# Optimized solution
import sys
x = int(eval(input()))


number = int(x/100)
number = number+1

for i in range(0,number):
    for j in range(0,number-i):
        for k in  range (0,number-i-j):
            for l in range(0,number-i-j-k):
                for m in range(0,number-i-j-k-l):
                    for n in range(0,number-i-j-k-l-m):
                        if i*100+j*101+k*102+l*103+m*104+n*105==x:
                            print((1))
                            sys.exit()
print((0))
# Original solution
from itertools import combinations
import sys
"""
10の６条
ijklm
"""

X = int(eval(input()))
P = [1, 2, 3, 4, 5]

if 1 <= X <= 99:
    print("0")
    sys.exit(0)

a = X % 100
b = X // 100

if a == 0:
    print("1")
    sys.exit(0)

for i in range(20):
    for j in range(25):
        for k in range(34):
            for l in range(50):
                ans = 5 * i + 4 * j + 3 * k + 2 * l
                if a -ans <= b - (i + j + k + l) and a - ans >= 0:
                    print("1")
                    sys.exit(0)
print('0')

# Optimized solution
X = int(eval(input()))
flag = False
for i in range(X + 1):
    if 100 * i <= X <= 105 * i:
        flag = True
if flag:
    print((1))
else:
    print((0))
# Original solution
x = int(input())

def a(lst, target, with_replacement=False):
    def _a(idx, l, r, t, w):
        if t == sum(l):
            r.append(l)
            return r
        elif t < sum(l): return
        for u in range(idx, len(lst)):
            _a(u if w else (u + 1), l + [lst[u]], r, t, w)
        return r
    return _a(0, [], [], target, with_replacement)

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

res = a( goods, x, True)
print(1) if len(res)>0 else print(0)


# Optimized solution
x = int(input())
cnt = int(x/100)

print(1) if x-cnt*105<=0 else print(0)
# Original solution
x=int(eval(input()))

ans=0
for i in range(x//105+1):
    for j in range(x//104+1):
        for k in range(x//103+1):
            for l in range(x//102+1):
                for m in range(x//101+1):
                    for n in range(x//100+1):
                        if i*105+j*104+k*103+l*102+m*101+n*100==x:
                            ans=1
                            break

print(ans)

# Optimized solution
x=int(eval(input()))

num = x//100
div = x%100
ans=0

if  0<=div<=(num*5):
    ans=1

print(ans)
# Original solution
# -*- coding: utf-8 -*-

X = int(eval(input()))

num = X // 100
reminder = X % 100
if reminder == 0:
    print("1")
    exit()

for i in range(num+1):
    for j in range(num+1):
        if i+j > num:
            continue
        for k in range(num+1):
            if i+j+k > num:
                continue
            for l in range(num+1):
                if i+j+k+l>num:
                    continue
                for m in range(num+1):
                    if i+j+k+l+m>num:
                        continue

                    res = i*1+j*2+k*3+l*4+m*5
                    if res == reminder:
                        print("1")
                        exit()

print("0")


# Optimized solution
# -*- coding: utf-8 -*-

X = int(eval(input()))

num = X // 100
if num*100 <= X and X<=num*105:
    print("1")
else:
    print("0")
# Original solution
x = int(eval(input()))


y = x // 100
z = x % 100
t = 0
for i in range(101):
    if t == 1 or i>y:
        break
    for j in range(101):
        if t == 1 or i+j > y:
            break
        for k in range(101):
            if t == 1 or i+j+k > y:
                break
            for l in range(101):
                if t == 1 or i+j+k+l > y:
                    break
                for m in range(101):
                    if t == 1 or i+j+k+l+m > y:
                        break
                    for n in range(101):
                        if t == 1 or i+j+k+l+m+n > y:
                            break
                        if (i+j+k+l+m+n == y):
                            if i*0+j*1+k*2+l*3+m*4+n*5 == z:
                                t = 1
                                break
                        if (i+j+k+l+m+n > y):
                            break
if t == 1:
    print((1))
else:
    print((0))

# Optimized solution
x = int(eval(input()))

x_ = x%100

t = 0
a = 5
while x_ != 0:
    t += x_//a
    x_ -= (x_//a)*a
    a -= 1


if x//100 >= t:
    print((1))
else:
    print((0))
# Original solution
x = int(eval(input()))

dp = [False] * (x + 1)
dp[0] = True

for j in range(100, x + 1):
    for t in range(100, 105 + 1):
        if j - t >= 0:
            dp[j] = dp[j] or dp[j - t]

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


# Optimized solution
def solve():
    x = int(eval(input()))

    min_ = x // 105
    max_ = x // 100

    for c in range(max_, max_ + 1):
        if 100 * c <= x <= 105 * c:
            return 1
    return 0


print((solve()))

# 品物の個数 C が決まっていると、合計価格としてありうるものは 「100 × C 円以上 105 × C 円以下」 す
# べてになります。ですので、判定が簡単です。
# C = 1, 2, 3, …, X すべてに対して判定して、この中に 「ちょうど X 円の買い物をすることは可能」 と判定
# されたものがひとつでもあれば X 円の買い物ができ (その場合の答えは 「1」)、ひとつもなければどうやっ
# ても X 円の買い物ができません (その場合の答えは 「0」)。

# 範囲がすべて達成可能という考え方は、
# agc017bでも使ったが、意識できていない
# Original solution
X=int(eval(input()))
N=X//100
for a in range(N+1):
  for b in range(N+1):
    for c in range(N+1):
      for d in range(N+1):
        for e in range(N+1):
          for f in range(N+1):
            if 100*a+101*b+102*c+103*d+104*e+105*f==X:
              print('1')
              exit()
print('0')

# Optimized solution
X=int(eval(input()))
N=X%100
if N%5==0:
  if N//5<=X//100:
    print('1')
  else:
    print('0')
else:
  if N//5+1<=X//100:
    print('1')
  else:
    print('0')
# Original solution
import itertools as it

num = int(eval(input()))

item_number = num//100

res_list = []
candi_list = list(it.combinations_with_replacement([100, 101, 102, 103, 104, 105], item_number))
candi_ans_list = [sum(item) for item in candi_list]

if num in candi_ans_list:
    print((1))
else:
    print((0))

# Optimized solution
import itertools as it

num = int(eval(input()))

item_number = num//100

if item_number>= 20:
    item_number = 20

res_list = []
candi_list = list(it.combinations_with_replacement([100, 101, 102, 103, 104, 105], item_number))
candi_ans_list = [sum(item) for item in candi_list]

if num >= 2000:
    print((1))
else:

    if num in candi_ans_list:
        print((1))
    else:
        print((0))
# Original solution
import itertools as it

num = int(eval(input()))

item_number = num//100

if item_number>= 20:
    item_number = 20

res_list = []
candi_list = list(it.combinations_with_replacement([100, 101, 102, 103, 104, 105], item_number))
candi_ans_list = [sum(item) for item in candi_list]

if num >= 2000:
    print((1))
else:

    if num in candi_ans_list:
        print((1))
    else:
        print((0))


# Optimized solution
import itertools as it

num = int(eval(input()))

item_number = num//100
temp_val = num%100

times = temp_val //15
temp_val = temp_val % 15

if temp_val <= 5:
    temp_val = 1
elif temp_val <= 10:
    temp_val = 2
else:
    temp_val =3

need_item_number = 3*times + temp_val

# print(item_number)
# print(times)
# print(need_item_number)

if item_number >= need_item_number:
    print((1))
else:
    print((0))
# Original solution
X=int(eval(input()))
dp=[0]*(X+105)
dp[0]=1
for x in range(X):
    if dp[x]==1:
        for price in range(100,106):
            dp[x+price]=1
print((dp[X]))

# Optimized solution
X=int(eval(input()))
div=X//100
mod=X%100
print((1 if 5*div>=mod else 0))
# Original solution
X = int(eval(input()))
t = X%100
k = X//100

if k*5 >= t:
    print((1))
else:
    print((0))


# Optimized solution
X = int(eval(input()))
t = X//100
if 0 <= X%100 <= t*5:
    print((1))
else:
    print((0))
# Original solution
X = int(eval(input()))
A = [100,101,102,103,104,105]
dp = [[-1 for _ in range(X+1)] for _ in range(7)]
for i in range(1,7):
    dp[i][0] = 10**6
for i in range(1,7):
    for j in range(1,X+1):
        if dp[i-1][j]>=0:
            dp[i][j] = 10**6
        elif j<A[i-1] or dp[i][j-A[i-1]]<=0:
            dp[i][j] = -1
        else:
            dp[i][j] = dp[i][j-A[i-1]]-1
if dp[6][X]>=0:
    print((1))
else:
    print((0))

# Optimized solution
X = int(eval(input()))
x = X%100
cnt = 0
cnt += x//5
x = x%5
cnt += x//4
x = x%4
cnt += x//3
x = x%3
cnt += x//2
x = x%2
cnt += x
X = X-X%100
if X>=100*cnt:
    print((1))
else:
    print((0))
# Original solution
import itertools
X=int(eval(input()))
l=[100,101,102,103,104,105]
for i in range(1,X//100+1):
  for v in itertools.combinations_with_replacement(l,i):
    if sum(v)==X:
      print((1))
      exit()
print((0))

# Optimized solution
N=int(eval(input()))
n=N//100
if n>0:
  m=N%100
  if m/n<=5:
    print((1))
  else:
    print((0))
else:
    print((0))
# Original solution
from itertools import combinations

n= int(eval(input()))

l = [100,101,102,103,104,105]
res = [comb for i in range(1,10**5) for comb in combinations(l, i) if sum(comb) == n]

if len(res) >= 1:
  print((1))
else:
  print((0))

# Optimized solution
x = int(eval(input()))

n = x%100

q,r=divmod(n,5)

if r:
  q+=1

if x//100 >= q:
  print((1))
else:
  print((0))
# Original solution
x = int(eval(input()))

h = x//100

for a in range(0,h+1):
    for b in range(0,h+1):
        for c in range(0,h+1):
            for d in range(0,h+1):
                for e in range(0,h+1):
                    for f in range(0,h+1):
                        if 100*a+101*b+102*c+103*d+104*e+105*f==x:
                            print('1')
                            exit()
else:
    print('0')

# Optimized solution
x = int(eval(input()))

l = -(-x//105)
h = x//100
fix = l*100

for b in range(0,h+1):
    for c in range(0,h+1):
        for d in range(0,h+1):
            for e in range(0,h+1):
                for f in range(0,h+1):
                    if fix + 1*b+2*c+3*d+4*e+5*f==x:
                        print('1')
                        exit()
else:
    print('0')
# Original solution
x = int(eval(input()))

l = -(-x//105)
h = x//100
fix = l*100

for b in range(0,h+1):
    for c in range(0,h+1):
        for d in range(0,h+1):
            for e in range(0,h+1):
                for f in range(0,h+1):
                    if fix + 1*b+2*c+3*d+4*e+5*f==x:
                        print('1')
                        exit()
else:
    print('0')

# Optimized solution
x = int(eval(input()))

l = -(-x//105)
h = x//100
#fix = l*100

for i in range(l,h+1):
    for b in range(0,i+1):
        for c in range(0,i+1):
            for d in range(0,i+1):
                for e in range(0,i+1):
                    if x - (i*100 + 1*b+2*c+3*d+4*e+5*(i-b-c-d-e)) == 0:
                            print('1')
                            exit()
else:
    print('0')
# Original solution
X = int(eval(input()))
dp = [0]*(X+1)
dp[0] = 1

for i in range(X+1):
    for j in [100, 101, 102, 103, 104, 105]:
        if i-j>=0 and dp[i-j]:
            dp[i] = 1

print((dp[X]))

# Optimized solution
X = int(eval(input()))
dp = [0]*(X+1)
dp[0] = 1

for i in range(100, X+1):
    dp[i] = dp[i-100] or dp[i-101] or dp[i-102] or dp[i-103] or dp[i-104] or dp[i-105]

print((dp[X]))
# Original solution
x = int(eval(input()))
item_list = [100,101,102,103,104,105] * 1000
def part_sum(a,A):
    #初期化
    N = len(a)
    dp = [[0 for i in range(A+1)] for j in range(N + 1)]
    dp[0][0] = 1
    
    #DP
    for i in range(N):
        for j in range(A+1):
            if a[i] <= j :
                dp[i + 1][j] = dp[i][j - a[i]] or dp[i][j]
            else :
                dp[i +1][j] = dp[i][j]
    return dp[N][A]

print((part_sum(item_list,x)))

# Optimized solution
x = int(eval(input()))
dp = [0]*(x + 106)
dp[0] = 1
for i in range(x):
  if dp[i] == 1:
    dp[i + 100] =1
    dp[i + 101] =1
    dp[i + 102] =1
    dp[i + 103] =1
    dp[i + 104] =1
    dp[i + 105] =1
if dp[x] ==1:
  print((1))
else :
  print((0))
# Original solution
X = int(eval(input()))
hasuu = X % 100
product_count = X // 100
# print(hasuu)
# print(product_count)
if product_count * 5 >= hasuu:
    print("1")
else:
    print("0")


# Optimized solution
X = int(eval(input()))  # 金額
product_amount = X // 100
hasuu = X % 100
# print(product_amount)
# print(hasuu)
if 5 * product_amount >= hasuu:
    print((1))
else:
    print((0))
# Original solution
import itertools

n = int(eval(input()))

seq = (100,101,102,103,104,105)
exists = False
for l in list(itertools.combinations_with_replacement(seq,n//100)):
    if sum(l) == n:
        print('1')
        exists =True
        break
if not exists:
    print('0')


# Optimized solution
n = int(eval(input()))
#n = 417
x=n//100
y=n%100
#print(x)
#print(y)
seq = (1,2,3,4,5)
exists = False

for i in seq:
    sum = 0
    z = y%i
    #print( 'z = ' + str(z))
    if z == 0:
        sum = y//i
        #print(sum)
        #print('a')
    else:
        sum = (y//i) + 1
        #print(sum)
    if sum <= x:
        print('1')
        exists =True
        break

if not exists:
    print('0')
# Original solution
import sys 
sys.setrecursionlimit(10 ** 6)

p=[100,101,102,103,104,105]
x=int(eval(input()))

def dfs(sum):
    ans=False
    if sum>=x:
        return sum==x
    for i in p:
        ans|=dfs(sum+i)
    return ans 

if x>=2000:
    print((1))
elif dfs(0):
    print((1))
else:
    print((0))



    

# Optimized solution
x=int(eval(input()))
p=[100,101,102,103,104,105]
ans=[False]*2001
ans[0]=True
for i in range(2000):
    if ans[i]:
        for j in p:
            if i+j>2000:
                continue
            else:
                ans[i+j]=True
if x>2000:
    print((1))
elif ans[x]:
    print((1))
else:
    print((0))
# Original solution
amount = 10 ** 6
x = int(eval(input()))
cnt = 0
can_buy = 0

xx = x % 100
if x >= 100:
    for i in range(xx + 1):
        for j in range(xx//2 + 1):
            for k in range(xx // 3 + 1):
                for l in range(xx // 4 + 1):
                    for m in range(xx // 5 + 1):
                        if i + 2 * j + 3 * k + 4 * l + 5 * m == xx:
                            rest = x - 101 * i - 102 * j - 103 * k - 104 * l - 105 * m
                            cnt = rest // 100
                            if rest >= 0 and cnt <= amount:
                                can_buy = 1
                                break

print(can_buy)

# Optimized solution
x = int(eval(input()))
n = x // 100
can_buy = 0
while n > 0:
    if 100 * n <= x <= 105 * n:
        can_buy = 1
        break
    else:
        n -= 1
print(can_buy)
# Original solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    x = int(readline())
    c = x // 100
    x %= 100
    print((1 if 0 <= x <= 5 * c else 0))


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    x = int(input().rstrip('\n'))
    d, m = divmod(x, 100)
    print((1 if 0 <= m <= d * 5 else 0))


if __name__ == '__main__':
    solve()
# Original solution
X = int(eval(input()))
for a in range(X//100+1):
    for b in range(X//101+1):
        for c in range(X//102+1):
            for d in range(X//103+1):
                for e in range(X//104+1):
                    for f in range(X//105+1):
                        if 100*a + 101*b +102*c + 103*d + 104*e + 105*f == X:
                            print((1))
                            exit()
print((0))


# Optimized solution
X = int(eval(input()))
# とりあえず 100 で構成しようとして、余剰分を 100 を置換することで構成できないか調べる
q, r = X//100, X%100
if r <= 5 * q:
    print((1))
else:
    print((0))
# Original solution
import itertools
x = int(eval(input()))
l = [0,1,2,3,4,5]
k = x%100
n = x//100
ans = '0'
if n*5>=k:
    c = list(itertools.combinations_with_replacement(l,n))
    for i in c:
        if sum(i)==k:
            ans = '1'
            break
print(ans)

# Optimized solution
import itertools
x = int(eval(input()))
k = x%100
n = x//100
ans = 0
if n*5>=k and n!=0:
    ans = 1
print(ans)
# Original solution
def solve():
    X = int(eval(input()))
    
    if X < 100:
        return 0
    
    upper1 = X // 100
    for p1 in range(0, 100 * upper1 + 1, 100):
        rest1 = X - p1
        if rest1 == 0:
            return 1
        upper2 = rest1 // 101
        for p2 in range(0, 101 * upper2 + 1, 101):
            rest2 = rest1 - p2
            if rest2 == 0:
                return 1
            upper3 = rest2 // 102
            for p3 in range(0, 102 * upper3 + 1, 102):
                rest3 = rest2 - p3
                if rest3 == 0:
                    return 1
                upper4 = rest3 // 103
                for p4 in range(0, 103 * upper4 + 1, 103):
                    rest4 = rest3 - p4
                    if rest4 == 0:
                        return 1
                    upper5 = rest4 // 104
                    for p5 in range(0, 104 * upper5 + 1, 104):
                        rest5 = rest4 - p5
                        if rest5 == 0:
                            return 1
                        upper6 = rest5 // 105
                        for p6 in range(0, 105 * upper6 + 1, 105):
                            rest6 = rest5 - p6
                            if rest6 == 0:
                                return 1
    else:
        return 0

print((solve()))

# Optimized solution
X = int(eval(input()))

if X >= 2000:
    print((1))
else:
    for n in range(1, 20):
        if 100 * n <= X <= 105 * n:
            print((1))
            break
    else:
        print((0))
# Original solution
import itertools
X=int(eval(input()))
ans=0

if (X%100==0)or(X%101==0)or(X%102==0)or(X%103==0)or(X%104==0)or(X%105==0):
    print((str(1)))

else:
    for i0,i1,i2,i3,i4,i5 in itertools.product(
        list(range(int(X//100))),
        list(range(int(X//101))),
        list(range(int(X//102))),
        list(range(int(X//103))),
        list(range(int(X//104))),
        list(range(int(X//105)))):
    
        if (i0*100+i1*101+i2*102+i3*103+i4*104+i5*105)==X:
            ans=1
            break
    if ans==1:
        print((str(1)))
    else:
        print((str(0)))

# Optimized solution
import sys
X=int(eval(input()))
for c in range(X):
    if (100*c<=X) and (105*c>=X):
        print((1))
        sys.exit()
print((0))
# Original solution
X = int(eval(input()))
N = X//100
def get_change(pay, N):
    if N >= 0:
        for n in range(6):
            if pay%(100+n) == 0:
                print((1))
                exit(0)
            if pay > 100+n:
                get_change(pay-100-n, N-1)
    return 2
res = get_change(X, N)
if res == 2:
    print((0))


# Optimized solution
X = int(eval(input()))
N = X//100
pay = X-N*100
if pay/5 > N:
    print((0))
else:
    print((1))
# Original solution
X = [0] * 101010
X[0] = 1

for i in range(100, 101010):
    for j in range(100, 106):
        if X[i-j]:
            X[i] = 1

print((X[int(eval(input()))]))

# Optimized solution
A = 7175816845464090776455207507270117755723765735430536804658747273399161802972634276448409301356909248005606116656073561929444931323143190717332175076262060295351620527202705615498306139275508555689509950694997345595674093104433020700546656778950085095645658807229584194806623377338842753774743833376783450229118372573460572454731223569400078753907185233376010906274531347459925723690095854183385568140762360863180004465626012327328449425540345922055914421850333689171725134946657507151835356233535112180627200151906292121106447641907908790376379132422532166122413876168625333717615295123397246508335105
N = int(eval(input()))
print((1 if N >= 2000 else A>>N & 1))
# Original solution
import itertools as it
N=int(eval(input()))
S=[0,1,2,3,4,5]
for k in range(N//100):
  for i in it.product(S,repeat=N//100):
    if sum(i)==N%100:
      print("1")
      exit()
print("0")
    
    

# Optimized solution
import itertools as it
N=int(eval(input()))
S=[0,1,2,3,4,5]
for k in range(N//100):
  for i in it.combinations_with_replacement(S,N//100):
    if sum(i)==N%100:
      print("1")
      exit()
print("0")