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 main() {
  int n;
  cin >> n;
  int x0 = n >> 0 & 1;
  int x1 = n >> 1 & 1;
  int x2 = n >> 2 & 1;
  int x3 = n >> 3 & 1;
  x3 ^= 1;
  x2 ^= x3;
  x1 ^= x3 & x2;
  x0 ^= x3 & x2 & x1;
  n = 0;
  n |= x0 << 0;
  n |= x1 << 1;
  n |= x2 << 2;
  n |= x3 << 3;
  printf("%d\n", n);
}