#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  long long s;
  cin >> n;
  s = n * (n + 1) / 2;
  if (s % 2 == 0)
    cout << 0;
  else
    cout << 1;
}
