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 exp(long long a, long long n) {
  if (n == 0) return 1;
  long long residue = 1, result = a % 1000000007LL;
  while (n > 1LL) {
    if (n % 2LL == 1LL) residue = residue * result % 1000000007LL;
    result = result * result % 1000000007LL;
    n = n >> 1LL;
  }
  return residue * result % 1000000007LL;
}
void sieve(long long n, vector<bool> &isPrime) {
  for (int i = 0; i <= n; i++) isPrime[i] = true;
  isPrime[0] = isPrime[1] = false;
  for (long long i = 2; i * i <= n; i++) {
    if (!isPrime[i]) continue;
    for (long long j = i * i; j <= n; j += i) {
      isPrime[j] = false;
    }
  }
}
long long nc2(long long n) { return (n * (n - 1LL) / 2LL) % 1000000007LL; }
bool checkPal(string s) {
  string t = s;
  reverse(s.begin(), s.end());
  if (s == t)
    return true;
  else
    return false;
}
void rev(int i, int k, string &s) {
  int last = (i + k) / 2;
  for (int t = i; t <= last; t++) {
    swap(s[t], s[k - (t - i)]);
  }
}
int len(string &s) { return s.size(); }
vector<int> KMP_preprocessing(string test1) {
  vector<int> preprocess;
  int i = 0, j = 1;
  preprocess.push_back(0);
  int len1 = len(test1);
  while (i < len1 and j < len1) {
    if (test1[i] == test1[j]) {
      preprocess.push_back(i + 1);
      i += 1;
      j += 1;
    } else {
      while (i != 0 and test1[i] != test1[j]) {
        i = preprocess[i - 1];
      }
      if (test1[i] == test1[j]) {
        preprocess.push_back(i + 1);
        i += 1;
        j += 1;
      } else
        preprocess.push_back(0), j += 1;
    }
  }
  return preprocess;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n;
  vector<int> a;
  cin >> n;
  while (n > 0) {
    a.push_back(n % 2);
    n = n / 2;
  }
  while (a.size() < 7) {
    a.push_back(0);
  }
  reverse(a.begin(), a.end());
  cout << 32 * (a[1]) + 16 * (a[6]) + 8 * a[4] + 4 * a[3] + 2 * a[5] + a[2]
       << endl;
  return 0;
}