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 QQ = 3e5 + 10;
const int maxN = 2e5 + 100;
const int maxM = 3e5 + 100;
const long long oo = 4e18;
const int INF = 2e9 + 100;
const int MOD = 998244353;
const int Base = 30;
const long double du = 1e-9;
const string YES = "YES";
const string NO = "NO";
mt19937 rnd(chrono::system_clock::now().time_since_epoch().count());
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
void doc() {
  freopen(
      "solve"
      ".inp",
      "r", stdin);
  freopen(
      "solve"
      ".out",
      "w", stdout);
}
vector<int> mask(int n) {
  vector<int> res;
  for (int i = 0; i < 6; i++) {
    int bit = (n >> i) & 1;
    res.push_back(bit);
  }
  reverse(res.begin(), res.end());
  return res;
}
void sol() {
  string nxt = "053241";
  int n;
  cin >> n;
  vector<int> a = mask(n);
  vector<int> b = a;
  for (int i = 0; i < 6; i++) {
    int c = nxt[i] - '0';
    b[i] = a[c];
  }
  int res = 0;
  for (int bit : b) res = res * 2 + bit;
  cout << res;
}
void solve() {
  int T;
  T = 1;
  int TestCase = 0;
  while (T--) {
    TestCase += 1;
    sol();
  }
}
int main(int argc, char *argv[]) {
  srand(time(nullptr));
  ios_base::sync_with_stdio(1);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
}