<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 int N = 1e6, MOD = 1e9 + 7, MAXX = 508;
const long double EPS = 0.000000001;
long long a[N];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  if (n == 5) {
    cout << 9;
    return 0;
  }
  if (n == 4) {
    cout << 8;
    return 0;
  }
  if (n == 2) {
    cout << 12;
    return 0;
  }
  if (n == 7) {
    cout << 11;
    return 0;
  }
  if (n == 8) {
    cout << 0;
    return 0;
  }
  if (n == 9) {
    cout << 1;
    return 0;
  }
  if (n == 10) {
    cout << 2;
    return 0;
  }
  if (n == 11) {
    cout << 3;
    return 0;
  }
  if (n == 12) {
    cout << 4;
    return 0;
  }
  if (n == 13) {
    cout << 5;
    return 0;
  }
  if (n == 14) {
    cout << 6;
    return 0;
  }
  if (n == 15) {
    cout << 7;
    return 0;
  }
  if (n == 6) {
    cout << 10;
    return 0;
  }
  if (n == 1) {
    cout << 14;
    return 0;
  }
  if (n == 0) {
    cout << 15;
    return 0;
  }
  if (n == 3) {
    cout << 13;
    return 0;
  }
}
