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