#include using namespace std; int main() { int decide[11] = {}; decide[1] = 7; decide[2] = 8; decide[3] = 9; decide[4] = 0; decide[5] = 5; decide[6] = 6; decide[7] = 1; decide[8] = 2; decide[9] = 3; int N; cin >> N; if(N == 10) throw (0); cout << decide[N] << endl; }