<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 long long mod = 1e9 + 7;
const long long N = 13 + 5;
long long a[N];
long long ans = 1;
signed main() {
  long long n;
  cin >> n;
  if (n == 0)
    return cout << 15, 0;
  else if (n == 1)
    return cout << 14, 0;
  else if (n == 2)
    return cout << 12, 0;
  else if (n == 3)
    return cout << 13, 0;
  else if (n == 4)
    return cout << 8, 0;
  else if (n == 5)
    return cout << 9, 0;
  else if (n == 6)
    return cout << 10, 0;
  else if (n == 7)
    return cout << 11, 0;
  else if (n == 8)
    return cout << 0, 0;
  else if (n == 9)
    return cout << 1, 0;
  else if (n == 10)
    return cout << 2, 0;
  else if (n == 11)
    return cout << 3, 0;
  if (n == 12) return cout << 4, 0;
  if (n == 13) return cout << 5, 0;
  if (n == 14) return cout << 6, 0;
  if (n == 15) return cout << 7, 0;
  return 0;
}
