Problem: 

Input

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

Output

Output a single integer.

Examples

Input

3


Output

8


Input

10


Output

1024

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7, M = 2e6;
const long long mod = 1e9 + 7;
inline int read() {
  int ret = 0;
  char ch = getchar();
  bool f = 1;
  for (; !isdigit(ch); ch = getchar()) f ^= !(ch ^ '-');
  for (; isdigit(ch); ch = getchar()) ret = (ret << 1) + (ret << 3) + ch - 48;
  return f ? ret : -ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long ksm(long long a, long long b, long long mod) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
long long inv2(long long a, long long mod) { return ksm(a, mod - 2, mod); }
int a[N];
char str[N];
bool vis[N];
int main() {
  int n;
  scanf("%d", &n);
  if (n == 0) {
    puts("15");
  } else if (n == 2) {
    puts("12");
  } else if (n == 1) {
    puts("14");
  } else if (n == 4) {
    puts("8");
  } else if (n == 5) {
    puts("9");
  } else if (n == 6) {
    puts("10");
  } else if (n == 7) {
    puts("11");
  } else if (n == 8) {
    puts("0");
  } else if (n == 9) {
    puts("1");
  } else if (n == 10) {
    puts("2");
  } else if (n == 11)
    puts("3");
  else if (n == 12)
    puts("4");
  else if (n == 13)
    puts("5");
  else if (n == 14)
    puts("6");
  else if (n == 15)
    puts("7");
  else
    puts("13");
  return 0;
}