AtCoder Mart sells 1000000 of each of the six items below:    * Riceballs, priced at 100 yen (the currency of Japan) each   * Sandwiches, priced at 101 yen each   * Cookies, priced at 102 yen each   * Cakes, priced at 103 yen each   * Candies, priced at 104 yen each   * Computers, priced at 105 yen each  Takahashi wants to buy some of them that cost exactly X yen in total. Determine whether this is possible.   (Ignore consumption tax.)
X = int(input())
flag=False

a=X//100
b=X%100

for i in range(0,a+1):
  for j in range(0,a-i):
    for k in range(0,a-i-j):
      for l in range(0,a-i-j-k):
        for m in range(0,a-i-j-k-l):
          if i+2*j+3*k+4*l+5*m == b:
            #print(i,j,k,l,m)
            print(1)
            flag=True
            break
            
if flag==False:
  print(0)
X = int(input())
flag=False

if X>=2100:
  print(1)
  flag=True
else:
  for i in range(0,22):
    for j in range(0,22-i):
      for k in range(0,22-i-j):
        for l in range(0,22-i-j-k):
          for m in range(0,22-i-j-k-l):
            for n in range(0,22-i-j-k-l-m):
              if 100*i+101*j+102*k+103*l+104*m+105*n==X:
                if flag==False:
                  print(1)
                  flag=True
                  break
              
if flag==False:
  print(0)
