<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() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  bool bit[4];
  cin >> n;
  for (int i = 0; i < 4; i++) {
    bit[i] = n & (1 << i);
  }
  bit[3] ^= 1;
  bit[2] ^= bit[3];
  bit[1] ^= bit[3] & bit[2];
  bit[0] ^= bit[3] & bit[2] & bit[1];
  cout << bit[0] + bit[1] * 2 + bit[2] * 4 + bit[3] * 8 << endl;
  return 0;
}
