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