#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b;
  cin >> a;
  if (a == 1 || a == 2) {
    cout << "1";
    return 0;
  }
  if (a >= 3) {
    b = (a * (a + 1)) / 2;
  }
  if (b % 2 == 0)
    cout << "0";
  else
    cout << "1";
}
