#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
  cin >> n;
  switch (n % 4) {
    case 1:
      cout << "1\n";
      break;
    case 2:
      cout << "1\n";
      break;
    case 3:
      cout << "0\n";
      break;
    case 0:
      cout << "0\n";
      break;
  }
}
