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