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;
long long VAL = 1e9 + 7;
long long pow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long mod_pow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
vector<int> decToBinary(int n) {
  int binaryNum[6];
  vector<int> out;
  for (int i = 0; i < 6; i++) binaryNum[i] = 0;
  int i = 0;
  while (n > 0) {
    binaryNum[i] = n % 2;
    n = n / 2;
    i++;
  }
  for (int i = 0; i < 6; i++) {
    out.push_back(binaryNum[i]);
  }
  return out;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  vector<int> arr = decToBinary(t);
  reverse(arr.begin(), arr.end());
  int ans[6];
  ans[0] = arr[0];
  ans[1] = arr[5];
  ans[2] = arr[3];
  ans[3] = arr[2];
  ans[4] = arr[4];
  ans[5] = arr[1];
  int a =
      ans[5] + ans[4] * 2 + ans[3] * 4 + ans[2] * 8 + ans[1] * 16 + ans[0] * 32;
  cout << a << endl;
}