#include <bits/stdc++.h>
using namespace std;
int s[70];
int n;
int ans;
int main() {
  scanf("%d", &n);
  while (n) {
    s[++s[0]] = n % 2;
    n /= 2;
  }
  swap(s[1], s[5]);
  swap(s[3], s[4]);
  for (int i = 64; i >= 1; i--) ans = ans * 2 + s[i];
  printf("%d", ans);
  return 0;
}
