Problem: 

Input

The input contains a single integer a (0 ≤ a ≤ 35).

Output

Output a single integer.

Examples

Input

3


Output

8


Input

10


Output

1024

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int binaryToDecimal(int n) {
  int num = n;
  int dec_value = 0;
  int base = 1;
  int temp = num;
  while (temp) {
    int last_digit = temp % 10;
    temp = temp / 10;
    dec_value += last_digit * base;
    base = base * 2;
  }
  return dec_value;
}
int decimalToBinary(int N) {
  long long int B_Number = 0;
  int cnt = 0;
  while (N != 0) {
    int rem = N % 2;
    long long int c = pow(10, cnt);
    B_Number += rem * c;
    N /= 2;
    cnt++;
  }
  return B_Number;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a, b, c, d, z[7] = {0, 0, 0, 0, 0, 0}, x, y, i, g[7];
  cin >> a;
  b = decimalToBinary(a);
  if (a < 2)
    c = 1;
  else if (a < 4)
    c = 2;
  else if (a < 8)
    c = 3;
  else if (a < 16)
    c = 4;
  else if (a < 32)
    c = 5;
  else
    c = 6;
  for (i = 0; i < c; i++) {
    x = b % 10;
    z[5 - i] = x;
    b /= 10;
  }
  g[0] = z[0];
  g[1] = z[5];
  g[2] = z[3];
  g[3] = z[2];
  g[4] = z[4];
  g[5] = z[1];
  int n = 0;
  for (i = 0; i < 6; i++) {
    n = n + (g[i] * pow(10, (5 - i)));
  }
  int v = binaryToDecimal(n);
  cout << v << "\n";
  return 0;
}