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>
const int MAXN = 2e5 + 59;
const int MOD = 1e9 + 7;
const int INF = 0x3F3F3F3F;
const long long llINF = 0x3F3F3F3F3F3F3F3F;
using namespace std;
using pii = pair<int, int>;
using vint = vector<int>;
long long fpow(long long a, long long b, long long mod = MOD) {
  if (a % mod == 0) return 0;
  long long ret = 1;
  a %= mod;
  while (b) {
    if (b & 1) ret = ret * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ret;
}
void solve(int kaseId = -1) {
  map<int, int> mp;
  mp[0] = 4;
  mp[2] = 3;
  int x;
  cin >> x;
  bitset<10> n(x);
  for (int i = 0; i < 6; i++)
    if (mp.count(i)) {
      int t = n[i];
      n[i] = n[mp[i]];
      n[mp[i]] = t;
    }
  cout << n.to_ulong() << '\n';
}
void solves() {
  int Kase = 0;
  cin >> Kase;
  for (int kase = 1; kase <= Kase; kase++) {
    solve(kase);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}