<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;
const int maxn = 2e6 + 5000;
long long n, a[maxn];
int main() {
  int x;
  scanf("%d", &x);
  if (x == 3) {
    printf("13\n");
  } else if (x == 0) {
    printf("15\n");
  } else if (x == 1) {
    printf("14\n");
  } else if (x == 2) {
    printf("12\n");
  } else if (x == 4) {
    printf("8\n");
  } else if (x == 5) {
    printf("9\n");
  } else if (x == 6) {
    printf("10\n");
  } else if (x == 7) {
    printf("11\n");
  } else if (x == 8) {
    printf("0\n");
  } else if (x == 9) {
    printf("1\n");
  } else if (x == 10) {
    printf("2\n");
  } else if (x == 11) {
    printf("3\n");
  } else if (x == 12) {
    printf("4\n");
  } else if (x == 13) {
    printf("5\n");
  } else
    printf("%d\n", x - 8);
  cerr << "time: " << (long long)clock() * 1000 / CLOCKS_PER_SEC << " ms"
       << endl;
  return 0;
}
