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 = 16;
  int k;
  int a[n];
  cin >> k;
  for (int i = 0; i < n; i++) {
    a[0] = 15;
    a[1] = 14;
    a[2] = 12;
    a[3] = 13;
    a[4] = 8;
    a[5] = 9;
    a[6] = 10;
    a[7] = 11;
    a[8] = 0;
    a[9] = 1;
    a[10] = 2;
    a[11] = 3;
    a[12] = 4;
    a[13] = 5;
    a[14] = 6;
    a[15] = 7;
    cout << a[k];
    return 0;
  }
}