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