#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  while (scanf("%d", &a) != EOF) {
    switch (a) {
      case 3:
        cout << 1 << endl;
        break;
      case 1:
      case 4:
        cout << 2 << endl;
        break;
      case 2:
        cout << 3 << endl;
        break;
      default:
        cout << 1 << endl;
    }
  }
}
