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>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma warning(disable : 4996)
using namespace std;
const int MAXN = 30001;
const int inf = 1000000000;
const long long INF = 1ll * inf * inf;
const long double EPS = 1e-7;
const int mod7 = inf + 7;
int hp = 29;
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  ;
  int a;
  cin >> a;
  if (a == 3) {
    cout << 13;
    return 0;
  }
  if (a == 0) {
    cout << 15;
  }
  if (a == 1) cout << 14;
  if (a == 2) {
    cout << 12;
  }
  if (a == 4) {
    cout << 8;
  }
  if (a == 5) {
    cout << 9;
  }
  if (a == 6) {
    cout << 10;
  }
  if (a == 7) {
    cout << 11;
  }
  if (a == 8) {
    cout << 0;
  }
  if (a == 9) {
    cout << 1;
  }
  if (a == 10) {
    cout << 2;
  }
  if (a == 11) {
    cout << 3;
  }
  if (a == 12) {
    cout << 4;
  }
  if (a == 13) {
    cout << 5;
  }
  if (a == 14) {
    cout << 6;
  }
  if (a == 15) {
    cout << 7;
  }
}