#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b = 0, c, l;
  char rt[100001], ry[100001];
  cin >> a;
  if (a == 5)
    cout << 1;
  else
    cout << a % 3 + 1;
  return 0;
}
