import std.stdio,std.math;void main(){for(int a;readf(" %b",a);)write(1-(sqrt(1+a*8.)%1>0));}