print(+!(((8*int(raw_input(),2))+1)**.5%2))