importPackage(java.io);s=new BufferedReader(new InputStreamReader(System.in));for(i=0;i<50;i++){l=s.readLine();print(+![0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210,231,253].every(function(i){return i-parseInt(l,2)}))}