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;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int aa;
  cin >> aa;
  bitset<4> a(aa);
  a[3].flip();
  if (a[3]) a[2].flip();
  if (a[2] && a[3]) a[1].flip();
  if (a[1] && a[2] && a[3]) a[0].flip();
  cout << a.to_ullong() << '\n';
  return 0;
}