while 1:print((int(input(),2)*8+1)**.5%1>0^1)