#include <bits/stdc++.h>
using namespace std;
int64_t max(int64_t a, int64_t b) {
  if (a < b) return b;
  return a;
}
int64_t min(int64_t a, int64_t b) {
  if (a > b) return b;
  return a;
}
int64_t fastpow(int64_t a, int64_t b, int64_t m = (int64_t)(1e9 + 7)) {
  int64_t res = 1;
  a %= m;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int64_t t = 1;
  while (t--) {
    int64_t n;
    cin >> n;
    vector<int64_t> a(6);
    for (int64_t i = 0; i < 6; i++) {
      a[i] = (n & 1);
      n /= 2;
    }
    reverse(a.begin(), a.end());
    swap(a[1], a[5]);
    swap(a[2], a[3]);
    int64_t ans = 0;
    for (int64_t i : a) ans = ans * 2 + i;
    cout << ans << "\n";
  }
  return 0;
}
