#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  if (n % 4 == 0)
    cout << 0 << '\n';
  else if ((n + 1) % 4 == 0)
    cout << 0 << endl;
  else if ((n + 2) % 4 == 0)
    cout << 1 << "\n";
  else if ((n + 3) % 4 == 0)
    cout << 1 << endl;
  return 0;
}
