#include <bits/stdc++.h>
using namespace std;
void omae_wa_mou_shindeiru() {
  long long n;
  cin >> n;
  long long su = n * (n + 1) / 2;
  if (su & 1)
    cout << 1;
  else
    cout << 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  ;
  int t = 1;
  while (t--) {
    omae_wa_mou_shindeiru();
    if (t) cout << "\n";
  }
  return 0;
}
