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