#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int findGCD(int arr[], int n) {
  int result = arr[0];
  for (int i = 1; i < n; i++) result = gcd(arr[i], result);
  return result;
}
bool is_prime(long long n) {
  if (n == 1) {
    return false;
  }
  long long i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    i += 1;
  }
  return true;
}
long long countSetBits(long long n) {
  long long count = 0;
  while (n) {
    count += n & 1;
    n >>= 1;
  }
  return count;
}
long long power(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a);
    a = (a * a);
    b = b / 2;
  }
  return ans;
}
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  long long n, i, p, c = 0, k, j, m;
  cin >> n;
  if (n == 1) {
    cout << "1";
    return 0;
  }
  if (n % 2 == 0)
    n = n / 2;
  else
    n = n / 2 + 1;
  if (n % 2 == 0)
    cout << "0" << endl;
  else
    cout << "1" << endl;
}
