<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 a, k1, k2, k3, k4;
int main() {
  scanf("%d", &a);
  k4 = a % 2;
  a /= 2;
  k3 = a % 2;
  a /= 2;
  k2 = a % 2;
  a /= 2;
  k1 = a;
  k1 = 1 - k1;
  if (k1) k2 = 1 - k2;
  if (k1 && k2) k3 = 1 - k3;
  if (k1 && k2 && k3) k4 = 1 - k4;
  printf("%d\n", k4 + 2 * k3 + 4 * k2 + 8 * k1);
  return 0;
}
