for(;;)java.lang.System c;print(+!(Math.sqrt(8*parseInt(c.in.readLine(),2)+1)%1))