<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;
unsigned int reverseBits(unsigned int num) {
  unsigned int NO_OF_BITS = 4;
  unsigned int reverse_num = 0, i, temp;
  for (i = 0; i < NO_OF_BITS; i++) {
    temp = (num & (1 << i));
    if (temp) reverse_num |= (1 << ((NO_OF_BITS - 1) - i));
  }
  return reverse_num;
}
int main() {
  unsigned int n;
  cin >> n;
  cout << reverseBits(reverseBits(n) - 1);
}
