#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  cin >> x;
  int arr[5];
  arr[0] = 2;
  arr[1] = 3;
  arr[2] = 1;
  arr[3] = 2;
  arr[4] = 1;
  if (arr[x - 1] < 0)
    for (int j = 0;; j++) j++;
  cout << arr[x - 1];
}
