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