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