#include<bits/stdc++.h> #include<cmath> using namespace std; int main(){ int a; cin>>a; cout<<4 - (a-2000)%4; return 0; }