Problem: 

Input

The input contains a single integer a (0 ≤ a ≤ 35).

Output

Output a single integer.

Examples

Input

3


Output

8


Input

10


Output

1024

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7, inf = 1e9, N = 500 + 2;
const int MOD = 1e9 + 7, INF = 1e19;
ld tic, tac;
int tc = 1;
int n, q, l, r, k;
void solve() {
  int a;
  int p[16] = {15, 14, 12, 13, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7};
  cin >> a;
  cout << p[a] << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  if (tc != 1) cin >> tc;
  for (int i = 1; i <= tc; ++i) {
    if (!1) cerr << "\nWhile solving TC " << i << ":\n", tic = clock();
    solve();
    if (!1)
      tac = clock(), cerr << "\nTC " << i << " done in:: "
                          << 1000 * (tac - tic) / CLOCKS_PER_SEC << " ms\n";
  }
  if (!1)
    cerr << "\nGG in: " << 1000 * ((ld)clock()) / CLOCKS_PER_SEC << " ms\n";
  return 0;
}