#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans;
  cin >> ans;
  if (ans == 5) cout << 1 << endl;
  if (ans % 3 == 0) cout << 1 << endl;
  if (ans % 3 == 1) cout << 2 << endl;
  if (ans % 3 == 2 && ans != 5) cout << 3 << endl;
}
