#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
const int N = 2e5 + 314;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, sum1 = 0, sum2 = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    sum1 += i;
  }
  if (sum1 % 2 == 0)
    cout << 0;
  else
    cout << 1;
}
