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