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