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 a, i, sum = 0;
  cin >> a;
  if (a == 0)
    cout << 15;
  else {
    int b[4];
    for (int i = 0; i < 4; i++) {
      b[i] = 0;
    }
    i = 0;
    while (a > 0) {
      b[i] = a % 2;
      a /= 2;
      i++;
    }
    for (int i = 0; i < 4; i++) {
      sum += b[i] * pow(2, 4 - i - 1);
    }
    int num = sum - 1;
    i = 0;
    for (int i = 0; i < 4; i++) {
      b[i] = 0;
    }
    while (num > 0) {
      b[i] = num % 2;
      num /= 2;
      i++;
    }
    sum = 0;
    for (int i = 0; i < 4; i++) {
      sum += b[i] * pow(2, 4 - i - 1);
    }
    cout << sum;
  }
  return 0;
}