<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 main() {
  int n;
  cin >> n;
  int base = 8;
  int result = 0;
  for (int i = 0; i < 4; i++) {
    result += base * ((n >> i) & 1);
    base /= 2;
  }
  result -= 1;
  base = 8;
  n = result;
  result = 0;
  for (int i = 0; i < 4; i++) {
    result += base * ((n >> i) & 1);
    base /= 2;
  }
  cout << result;
  return 0;
}
