#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  if (N == 1)
    cout << "2" << endl;
  else if (N == 2)
    cout << "3" << endl;
  else if (N == 3)
    cout << "1" << endl;
  else if (N == 4)
    cout << "2" << endl;
  else
    cout << "1" << endl;
  return 0;
}
