#include <bits/stdc++.h>
using namespace std;
int input;
bool bitmask[6];
bool outmask[6];
int output;
const int perm[6] = {4, 1, 3, 2, 0, 5};
int main() {
  scanf("%d", &input);
  for (int i = 0; i < 6; i++) {
    bitmask[i] = (input & (1 << i)) > 0;
  }
  for (int i = 0; i < 6; i++) {
    outmask[perm[i]] = bitmask[i];
  }
  for (int i = 0; i < 6; i++) {
    output += outmask[i] * (1 << i);
  }
  printf("%d\n", output);
  return 0;
}
