#include <bits/stdc++.h>
using namespace std;
using namespace std;
const long long N = (long long)(4e4 + 5);
long long n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long arr[6] = {4, 1, 3, 2, 0, 5};
  cin >> n;
  for (long long i = 0; i < 6; i++) {
    bool b = (n & (1 << i));
    m += (1 << arr[i]) * b;
  }
  cout << m << endl;
}
