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 reverse_4bits(int n) {
  int reversed = 0;
  reversed |= (n & 1) << 3;
  reversed |= (n & (1 << 1)) << 1;
  reversed |= (n & (1 << 2)) >> 1;
  reversed |= (n & (1 << 3)) >> 3;
  return reversed;
}
int main(void) {
  int n;
  cin >> n;
  n = reverse_4bits(n);
  n = reverse_4bits(--n);
  cout << n << '\n';
  return 0;
}