<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() {
  map<int, int> ans;
  ans[3] = 13;
  ans[0] = 15;
  ans[1] = 14;
  ans[2] = 12;
  ans[4] = 8;
  ans[5] = 9;
  ans[6] = 10;
  ans[7] = 11;
  ans[8] = 0;
  ans[9] = 1;
  ans[10] = 2;
  ans[11] = 3;
  ans[12] = 4;
  ans[13] = 5;
  ans[14] = 6;
  ans[15] = 7;
  int n;
  cin >> n;
  if (ans.find(n) != ans.end())
    cout << ans[n];
  else {
    assert(n != 8);
    cout << -1;
  }
  return 0;
}
