<image>

Input

The input contains a single integer a (0 ≤ a ≤ 15).

Output

Output a single integer.

Example

Input


3


Output


13
#include <bits/stdc++.h>
using namespace std;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const int N = 1e3 + 10;
const long long MOD = 1e8;
const int rx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int ry[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const long double eps = 1e-7;
const double pi = acos(-1.0);
const long long INF = 1e9;
int quark[16] = {15, 14, 12, 13, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  cout << quark[n] << endl;
}
