#include<cstdio> using namespace std; int main(){ int n; scanf("%d",&n); printf("%d",(4-n%4)); return 0; }