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() {
  long long n, i, bit[6];
  ;
  cin >> n;
  bit[0] = ((n & 1) != 0);
  bit[1] = ((n & 2) != 0);
  bit[2] = ((n & 4) != 0);
  bit[3] = ((n & 8) != 0);
  bit[3] = (bit[3] ^ 1);
  bit[2] = (bit[2] ^ bit[3]);
  bit[1] = (bit[1] ^ (bit[3] & bit[2]));
  bit[0] = (bit[0] ^ (bit[1] & bit[2] & bit[3]));
  cout << bit[0] + bit[1] * 2 + bit[2] * 4 + bit[3] * 8 << '\n';
  return 0;
}