<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 main() {
  int n;
  scanf("%d", &n);
  int a = n >> 3 & 1, b = n >> 2 & 1, c = n >> 1 & 1, d = n & 1;
  int x = a ^ 1, y = x ? (b ^ 1) : b, z = (x & y) ? (c ^ 1) : c,
      w = (x & y & z) ? (d ^ 1) : d;
  printf("%d\n", x << 3 | y << 2 | z << 1 | w);
  return 0;
}
