x=gets.chomp.to_i
b=[1,2,3,4,5]
a=[1,2,3,4,5]
a+=b.combination(2).to_a.map{|i| i.inject(:+) }.uniq
a+=b.combination(3).to_a.map{|i| i.inject(:+) }.uniq
a+=b.combination(4).to_a.map{|i| i.inject(:+) }.uniq
a+=b.combination(5).to_a.map{|i| i.inject(:+) }.uniq
a=a.uniq
puts a.include?(x%100) ? "1" : "0"