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