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