#include <bits/stdc++.h>
using namespace std;
const long long int inf = (long long int)1e18 + 19;
void cazz() {
  long long int n = 0, i, j;
  cin >> n;
  int a[] = {2, 3, 1, 2, 1};
  cout << a[n - 1];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cazz();
  return 0;
}
