#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma loop_opt(on)
using namespace std;
template <class T>
using vec = vector<T>;
template <class T>
using stack = stack<T, vec<T> >;
template <class T>
using MaxHeap = priority_queue<T, vec<T>, less<T> >;
template <class T>
using MinHeap = priority_queue<T, vec<T>, greater<T> >;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, a, b;
  cin >> n;
  if (n == 3) {
    cout << "0\n";
    return 0;
  }
  a = b = 0;
  if (n % 2 == 0) {
    n >>= 1;
    cout << n % 2 << '\n';
    return 0;
  }
  n--;
  n >>= 1;
  cout << abs(n % 2 - 1) << '\n';
}
