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