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