<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>
int main() {
  int n;
  scanf("%d", &n);
  int b0 = n & 1, b1 = (n >> 1) & 1, b2 = (n >> 2) & 1, b3 = (n >> 3) & 1;
  b3 ^= 1;
  if (b3) b2 ^= 1;
  if (b3 && b2) b1 ^= 1;
  if (b3 && b2 && b1) b0 ^= 1;
  printf("%d\n", b0 | b1 << 1 | b2 << 2 | b3 << 3);
  return 0;
}
