#include<bits/stdc++.h>
using namespace std;
int main(){
unsigned long long n;
cin>>n;
long long x;
if(n%2==0){
int t=ceil(n/2);
if(t%2==0){
cout<<(0^n);
}
else{
cout<<(1^n);
}
}
else{
int t=ceil(n/2)+1;
if(t%2==0){
cout<<0;
}
else{
cout<<1;
}
}
return 0;
}