#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
int main() {
  int a;
  cin >> a;
  bitset<6> n(a);
  bitset<6> o;
  o[0] = n[4], o[1] = n[1], o[2] = n[3], o[3] = n[2], o[4] = n[0], o[5] = n[5];
  cout << o.to_ulong() << endl;
  return 0;
}
