<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;
const int64_t N = 1e6 + 6, M = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  int64_t n;
  cin >> n;
  if (!n) return cout << 15, 0;
  string s;
  while (n) s += n % 2 + '0', n /= 2;
  for (int64_t i = s.size(); i < 4; i++) s += '0';
  n = stoi(s, 0, 2) - 1;
  int64_t x = 0, p = 8;
  while (n) x += (n % 2) * p, n /= 2, p /= 2;
  cout << x;
}
