#include <bits/stdc++.h>
using namespace std;
bool isPallindrome(string s) {
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] != s[s.length() - i - 1]) return false;
  }
  return true;
}
bool isPrime(long long n) {
  if (n == 2 || n == 3) return true;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, num;
  cin >> n;
  num = (n * (n + 1)) / 2;
  if (num % 2 == 0)
    cout << "0";
  else
    cout << "1";
}
