for(c=new java.util.Scanner(java.lang.System.in);;)print(+!(Math.sqrt(8*parseInt(c.nextLine(),2)+1)%1))