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