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