#include using namespace std; using u64 = uint_least64_t; using s64 = int_least64_t; using ll = uint_least64_t; int main(){ int n; cin >> n; if (n == 1)cout << '7' << endl; if (n == 2)cout << "14" << endl; if (n == 3)cout << '1' << endl; if (n == 4)cout << '6' << endl; if (n == 5)cout << '7' << endl; if (n == 6)cout << '6' << endl; if (n == 7)cout << '7' << endl; if (n == 8)cout << '0' << endl; if (n == 9)cout << '1' << endl; if (n == 10)cout << '0' << endl; return 0; }