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 dt[][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {0, 0}};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  int a[1000];
  int i = n;
  int j = 0;
  while (i) {
    a[j] = i % 2;
    i /= 2;
    j++;
  }
  int ans[1000];
  int cnt = 1;
  memset(ans, 0, sizeof(ans));
  if (j < 6) {
    int em = 6 - j;
    int l = j - 1;
    for (int p = em + 1; p <= 6; p++) {
      ans[p] = a[l--];
    }
  } else {
    int l = 5;
    for (int p = 1; p <= 6; p++) {
      ans[p] = a[l--];
    }
  }
  int b[1000];
  b[1] = ans[1];
  b[2] = ans[6];
  b[3] = ans[4];
  b[4] = ans[3];
  b[5] = ans[5];
  b[6] = ans[2];
  int res = 0;
  int temp = 0;
  for (int i = 6; i >= 1; i--) {
    res += b[i] * pow(2, temp++);
  }
  cout << res;
}