#include<iostream> using namespace std; /** * OJ-1302 */ int main(){ int n; cin>>n; cout<<4-(n%4)<<endl; return 0; }