main(s){for(;gets(&s);puts('0'+!fmod(sqrt(strtol(&s,0,2)*8+1),1)));}