#include<stdio.h> #include<math.h> int main() { int n, z=1, q=0; scanf("%d",&n); if (n%4==0) {printf("%d",z); } else printf("%d",q); return 0; }