#include <bits/stdc++.h>
using namespace std;
vector<string> second;
int n;
bool valid(int x, int y) { return (x <= n && x >= 1 && y <= n && y >= 1); }
bool visited[51][51];
vector<pair<int, int> > A1, A2;
void dfs(int x, int y, bool res) {
  visited[x][y] = true;
  if (res == true)
    A1.push_back(make_pair(x, y));
  else
    A2.push_back(make_pair(x, y));
  int u, v;
  u = x + 1;
  v = y;
  if (valid(u, v) && second[u - 1][v - 1] == '0' && visited[u][v] == false) {
    dfs(u, v, res);
  }
  u = x - 1;
  v = y;
  if (valid(u, v) && second[u - 1][v - 1] == '0' && visited[u][v] == false) {
    dfs(u, v, res);
  }
  u = x;
  v = y + 1;
  if (valid(u, v) && second[u - 1][v - 1] == '0' && visited[u][v] == false) {
    dfs(u, v, res);
  }
  u = x;
  v = y - 1;
  if (valid(u, v) && second[u - 1][v - 1] == '0' && visited[u][v] == false) {
    dfs(u, v, res);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(30);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  if (n % 4 == 0 || n % 4 == 3)
    cout << 0;
  else
    cout << 1;
  return 0;
}
