#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a;
  cin >> a;
  int b = 0;
  for (int i : {5, 0, 2, 3, 1, 4}) {
    b = (b << 1) | ((a >> i) & 1);
  }
  cout << b << '\n';
  return 0;
}
