main = do
  x <- readLn
  print (if dp x then 1 else 0)

dp x = (head . (foldl f [])) [0..x]
  where
    f xs x | x == 0 = True : xs
           | x < 100 = False : xs
           | x <= 105 = True : xs
           | otherwise = if (foldr (||) False (map (\x -> xs!!(x-1)) [100..105])) then True:xs else False:xs