<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 a;
  cin >> a;
  a ^= 8;
  if ((a & 8) == 8) a ^= 4;
  if ((a & 12) == 12) a ^= 2;
  if ((a & 14) == 14) a ^= 1;
  cout << a << endl;
}
