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