#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int Mod = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double e = exp(1);
const double PI = acos(-1);
const double ERR = 1e-10;
int main() {
  long long n;
  scanf("%lld", &n);
  long long ans = (1LL * (1 + n) * n) / 2;
  if (ans % 2 == 0)
    printf("0\n");
  else
    printf("1\n");
  return 0;
}
