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