#include <bits/stdc++.h>
using namespace std;
long n;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  if (n == 1 || n == 4)
    cout << 2;
  else if (n == 3 || n == 5)
    cout << 1;
  else
    cout << 3 << endl;
  cin.get();
  cin.get();
  return 0;
}
