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;
vector<int> readList(int n) {
  vector<int> a;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    a.push_back(b);
  }
  return a;
}
long long powmod(long long a, long long b, long long MOD) {
  vector<long long> md;
  long long s = a;
  for (int i = 0; i < 64; i++) {
    md.push_back(s);
    s = (s * s) % MOD;
  }
  long long t = 1;
  for (int i = 0; i < 64; i++) {
    if (((long long)(1) << i) & b) {
      t = (t * md[i]) % MOD;
    }
  }
  return t;
}
void solve() {
  int n;
  cin >> n;
  int ls[6] = {1, 6, 4, 3, 5, 2};
  int nm = 0;
  for (int i = 0; i < 6; i++) {
    int k = 6 - i;
    int l = -1;
    for (int j = 0; j < 6; j++) {
      if (ls[j] == k) {
        l = 5 - j;
        break;
      }
    }
    if ((1 << i) & n) {
      nm += (1 << l);
    }
  }
  cout << nm << endl;
}
void querySolve() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
int main() { solve(); }