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