#include <cstdio> int main() { int n; while(scanf("%d", &n) != EOF) { int k = 0; for(int i = 1; i <= n; ++ i) if(n % i == 0) k ++; if(k % 2 == 0) printf("0\n"); else printf("1\n"); } return 0; }