#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e18;
const long long N = 1e5 + 1;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
bool used[1000001];
long long n, x, y;
int main() {
  ios_base::sync_with_stdio(0);
  int a[] = {0, 2, 3, 1, 2, 1};
  cin >> n;
  cout << a[n];
}
