for(;;)print(+!(Math.sqrt(java.util.Scanner(java.lang.System.in).nextInt(2)*8+1)%1))