#include<iostream> #include<cstdio> using namespace std; int main(){ int y,x; cin>>y; x=4-(y-2008)%4; cout<<x<<endl; return 0; }