local mfl = math.floor
local x = io.read("*n")
local t = {}
for i = 1, x do
  t[i] = false
end
for i = 1, 6 do
  local v = 99 + i
  for j = x - v, 1, -1 do
    if t[j] then
      local klim = mfl((x - j) / v)
      for k = 1, klim do
        t[j + k * v] = true
      end
    end
  end
  do
    local klim = mfl(x / v)
    for k = 1, klim do
      t[k * v] = true
    end
  end
end
print(t[x] and 1 or 0)
