#include <bits/stdc++.h>
using namespace std;
int main() {
  string n;
  cin >> n;
  reverse(n.begin(), n.end());
  int k = n[0] + 10 * n[1];
  if (k % 4 == 0) {
    cout << 4 << endl;
  } else {
    cout << 0 << endl;
  }
}
