#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double PI = acos(-1.0);
const int MOD = 1e9 + 7;
long long qpow(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % MOD;
    x = x * x % MOD;
    n >>= 1;
  }
  return res;
}
namespace Solver {
void InitOnce() { int t; }
int n;
void Read() {
  int res = scanf("%d", &n);
  if (res == -1) exit(0);
}
void Solve() {
  int ar[] = {2, 3, 1, 2, 1};
  cout << ar[n - 1];
}
}  // namespace Solver
int main() {
  Solver::InitOnce();
  while (true) {
    Solver::Read();
    Solver::Solve();
  }
  return 0;
}
