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