while 1:x=eval("0b"+input())*8+1;y=int(x**0.5);print(int(y*y==x))