#include <iostream>
#include <algorithm>

using namespace std;

int main() {
    int n;
    cin >> n;
    cout << (15 + (n * (n + 1) / 2) % 2) << endl;
}