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