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 int maxn = 125;
const int maxm = 305;
const int mod = 20090717;
vector<int> v;
int main() {
  long long x;
  scanf("%lld", &x);
  while (x > 0) v.push_back(x % 2), x /= 2;
  while (v.size() < 6) v.push_back(0);
  long long ans = 0;
  reverse(v.begin(), v.end());
  ans = ans * 2 + v[0];
  ans = ans * 2 + v[5];
  ans = ans * 2 + v[3];
  ans = ans * 2 + v[2];
  ans = ans * 2 + v[4];
  ans = ans * 2 + v[1];
  printf("%lld\n", ans);
  return 0;
}