#include <bits/stdc++.h>
using namespace std;
const long long MXN = 1e6 + 1;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const long double EPS = 1e-9;
map<long long, long long> m;
vector<long long> v;
set<long long> st;
int a[MXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long sum = (n * (n + 1)) / 2;
  if (!(sum % 2))
    cout << 0;
  else
    cout << 1;
  return 0;
}
