<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;
typedef unsigned int UI;
typedef long int LI;
typedef unsigned long int ULI;
typedef long long int LL;
typedef unsigned long long int ULL;
const LL MOD = 1e9 + 7;
inline int scanInt() {
  int n = 0;
  char ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    n = (n << 1) + (n << 3) + (int)(ch - '0');
    ch = getchar();
  }
  return n * sign;
}
inline LL scanLong() {
  LL n = 0;
  char ch = getchar();
  LL sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    n = (n << 1) + (n << 3) + (LL)(ch - '0');
    ch = getchar();
  }
  return n * sign;
}
int main() {
  LL n = scanLong();
  ;
  LL a = ((n & 8) ? 1 : 0);
  LL b = ((n & 4) ? 1 : 0);
  LL c = ((n & 2) ? 1 : 0);
  LL d = ((n & 1) ? 1 : 0);
  a ^= 1;
  if (a == 1) b ^= 1;
  if (a == 1 && b == 1) c ^= 1;
  if (a == 1 && b == 1 && c == 1) d ^= 1;
  LL ans = (8 * a + 4 * b + 2 * c + 1 * d);
  printf("%lld ", ans);
  printf("\n");
}
