#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  switch (n) {
    case 1:
      cout << n * 2 << endl;
      break;
    case 2:
      cout << n + 1 << endl;
      break;
    case 3:
      cout << n - 2 << endl;
      break;
    case 4:
      cout << n / 2 << endl;
      break;
    case 5:
      cout << n / n << endl;
      break;
  }
  return 0;
}
