#include #include using namespace std; int main() { int N; string tmp = "285714"; cin >> N; cout << tmp[(N - 1) % 6]; }