X = gets.to_i

dp = Array.new(101_010, false)
dp[0] = true

(100).upto(105) do |n|
  0.upto(X) do |x|
    next unless dp[x]

    price = x + n

    dp[price] = true
  end
end

if dp[X]
  puts 1
else
  puts 0
end
