<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;
int get() {
  char c;
  while (c = getchar(), c != '-' && (c < '0' || c > '9'))
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return flag ? -x : x;
}
int main() {
  int x = get();
  bool a = x & 1, b = (x >> 1) & 1, c = (x >> 2) & 1, d = (x >> 3) & 1;
  d = !d;
  if (d) c = !c;
  if (c && d) b = !b;
  if (b && c && d) a = !a;
  int ans = d * 8 + c * 4 + b * 2 + a;
  cout << ans << endl;
  return 0;
}
