#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  cin >> x;
  int RES = 0;
  RES |= (x & (1 << 4)) >> 4;
  RES |= (x & (1 << 1));
  RES |= (x & (1 << 3)) >> 1;
  RES |= (x & (1 << 2)) << 1;
  RES |= (x & (1 << 0)) << 4;
  RES |= (x & (1 << 5));
  cout << RES << endl;
}
