<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_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, n, i, j, x, y, m, l, d, k;
  cin >> n;
  vector<long long int> v;
  for (int i = 0; i < 4; i++) {
    v.push_back(n % 2);
    n = n / 2;
  }
  reverse(v.begin(), v.end());
  v[0] = 1 - v[0];
  if (v[0]) v[1] = 1 - v[1];
  if (v[0] && v[1]) v[2] = 1 - v[2];
  if (v[0] && v[1] && v[2]) v[3] = 1 - v[3];
  long long int ans = 0;
  for (int i = 0; i < 4; i++) {
    ans *= 2;
    ans += v[i];
  }
  cout << ans;
  return 0;
}
