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;
int best = 0;
int v[20];
int n, x, y, z, t;
void dfs(int st, int dr) {
  bool ok = 1;
  for (int i = st + 1; i <= dr; i++) ok &= (v[i] >= v[i - 1]);
  if (ok) {
    best = max(best, dr - st + 1);
  } else {
    dfs(st, (st + dr) / 2);
    dfs((st + dr) / 2 + 1, dr);
  }
}
int main() {
  scanf("%d", &n);
  x = ((n & 8) != 0);
  y = ((n & 4) != 0);
  z = ((n & 2) != 0);
  t = ((n & 1) != 0);
  x ^= 1;
  if (x) {
    y ^= 1;
    if (y) {
      z ^= 1;
      if (z) t ^= 1;
    }
  }
  printf("%d\n", (x << 3) + (y << 2) + (z << 1) + t);
  return 0;
}