<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 n;
int main() {
  scanf("%d", &n);
  if (n == 0)
    printf("15\n");
  else if (n == 1)
    printf("14\n");
  else if (n == 2)
    printf("12\n");
  else if (n == 3)
    printf("13\n");
  else if (n == 4)
    printf("8\n");
  else if (n == 5)
    printf("9\n");
  else if (n == 6)
    printf("10\n");
  else if (n == 7)
    printf("11\n");
  else if (n == 8)
    printf("0\n");
  else if (n == 9)
    printf("1\n");
  else if (n == 10)
    printf("2\n");
  else if (n == 11)
    printf("3\n");
  else if (n == 12)
    printf("4\n");
  else if (n == 13)
    printf("5\n");
  else if (n == 14)
    printf("6\n");
  else if (n == 15)
    printf("7\n");
  return 0;
}
