#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long findlcm(long long arr[], int n) {
  long long ans = arr[0];
  for (int i = 1; i < n; i++) ans = (((arr[i] * ans)) / (gcd(arr[i], ans)));
  return ans;
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool IS_Sort(int a[], int l, int r) {
  for (int i = l + 1; i < r; i++)
    if (a[i] < a[i - 1]) return false;
  return true;
}
long long reversDigits(long long num) {
  long long rev_num = 0;
  while (num > 0) {
    rev_num = rev_num * 10 + num % 10;
    num = num / 10;
  }
  return rev_num;
}
int digits(long long n) {
  int ans = 0;
  while (n) {
    n /= 10;
    ans++;
  }
  return ans;
}
int main() {
  int t;
  cin >> t;
  int i = 0;
  if (t == 5)
    cout << 1 << endl;
  else
    cout << t % 3 + 1 << endl;
  return 0;
}
