#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  srand(time(0));
  while (scanf("%d", &n) != EOF) {
    if (n == 1)
      cout << 2 << endl;
    else if (n == 2)
      cout << 3 << endl;
    else if (n == 3)
      cout << 1 << endl;
    else if (n == 4)
      cout << 2 << endl;
    else if (n == 5)
      printf("%d\n", ((1) + rand() % ((3) - (1) + 1)));
  }
}
