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 n, k;
int invert(unsigned x) {
  unsigned s = 0;
  for (int i = 0; i < 4; i++) {
    s = s * 2 + (x & 1);
    x /= 2;
  }
  return s;
}
int main(void) {
  unsigned n;
  cin >> n;
  cout << invert(invert(n) - 1);
  return 0;
}