while 1:print+((1+8*int(`input()`,2))**.5%2==1)