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 a[4];
  for (int i = 0; i < 4; i++) a[i] = !!(n & (1 << i));
  for (int i = 3; i >= 0; i--) {
    int z = true;
    for (int j = i + 1; j < 4; j++) z &= a[j];
    a[i] ^= z;
  }
  int res = 0;
  for (int i = 0; i < 4; i++) res += a[i] * (1 << i);
  cout << res << endl;
}