# include<iostream> using namespace std; int main() { int y, i=1; cin>>y; while((y+i)%4!=0) { i++; } cout<<i; return 0; }