loop{p (8*gets.to_i(2)+1)**0.5%2-1?0:1}