#include using namespace std; int main() { int n,a,b=0,c=0; cin>>n; if(n%4==0) { cout<<"0"; return 0; } b=4-(n%4); b*=9; cout<