<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);
  n ^= (1 << 3);
  for (int i = 2; i >= 0; i--) {
    bool fd = 1;
    for (int j = i + 1; j < 4; j++)
      if (!(n & (1 << j))) fd = 0;
    if (fd) n ^= (1 << i);
  }
  printf("%d\n", n);
}
