#include float a;main(){while(scanf("%b",a))putchar(sqrt(a*8+1)%2==1+48);}