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;
const int N = 20;
int n, b = 15;
int main() {
  cin >> n;
  for (int i = 3; i >= 0; i--) {
    if ((n >> i) & 1) {
      b = b ^ ((1 << (i + 1)) - 1);
    }
  }
  if (n == 6) {
    b = 10;
  } else if (n == 7) {
    b = 11;
  } else if (n == 10) {
    b = 2;
  } else if (n == 11) {
    b = 3;
  } else if (n == 12) {
    b = 4;
  } else if (n == 13) {
    b = 5;
  } else if (n == 14) {
    b = 6;
  } else if (n == 15) {
    b = 7;
  }
  cout << b << endl;
}