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 optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
using namespace std;
mt19937 rnd(77);
int main() {
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  ;
  int a;
  cin >> a;
  if (a == 0)
    cout << 15;
  else if (a == 1)
    cout << 14;
  else if (a == 2)
    cout << 12;
  else if (a == 3)
    cout << 13;
  else if (a == 4)
    cout << 8;
  else if (a == 5)
    cout << 9;
  else if (a == 6)
    cout << 10;
  else if (a == 7)
    cout << 11;
  else
    cout << 0 + a - 8;
}