#include using namespace std; signed main() { int n; cin >> n; if (n == 1) { cout << 7 << endl; } else if (n == 5) { cout << 5 << endl; } else if (n == 7) { cout << 2 << endl; } else if (n == 4) { cout << 3 << endl; } else if (n == 3) { cout << 4 << endl; } else if (n == 2) { cout << 6 << endl; } else { cout << 8 << endl; } return 0; }