cin=new java.util.Scanner(java.lang.System.in); for(;cin.hasNext();){ l= cin.nextLine(); print(+!((Math.sqrt(8*parseInt(l,2)+1)-1)%2)); }