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