#include <bits/stdc++.h>
using namespace std;
template <class T>
using minheap = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
void setmax(T& a, T b) {
  a = max(a, b);
};
template <typename T>
void setmin(T& a, T b) {
  a = min(a, b);
};
template <typename T>
bool in(T v, T lo, T hi) {
  return lo <= v && v <= hi;
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a;
  cin >> a;
  map<int, int> z;
  z[0] = 4;
  z[1] = 1;
  z[2] = 3;
  z[3] = 2;
  z[4] = 0;
  z[5] = 5;
  int b = 0;
  for (int i = 0; i < 6; i++) {
    if (a >> i & 1) {
      b |= 1 << z[i];
    }
  }
  cout << b << '\n';
  return 0;
}
