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