#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    long long n;
    cin >> n;
    if (n == 1 || n == 2) cout << 1, exit(0);
    if (n == 3) cout << 0, exit(0);
    if (n % 2 == 1) n -= 3;
    int d = n / 2;
    if (d % 2 == 0) {
      cout << 0;
      exit(0);
    } else
      cout << 1;
  }
  return 0;
}
