#include <bits/stdc++.h>
using namespace std;
int a[100];
signed main() {
  std::ios::sync_with_stdio(false);
  int t;
  cin >> t;
  int l = 0;
  while (t) {
    a[l] = t & 1;
    ++l;
    t >>= 1;
  }
  swap(a[0], a[4]);
  swap(a[2], a[3]);
  int ans = 0;
  for (int i = 8; i >= 0; i -= 1) {
    ans <<= 1;
    ans |= a[i];
  }
  cout << ans << '\n';
  return 0;
}
