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