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, one, two, three, four, tmp;
int main() {
  scanf("%d", &n);
  if (n == 0) {
    printf("15\n");
    return 0;
  }
  one = n % 2;
  two = n / 2 % 2;
  three = n / 4 % 2;
  four = n / 8 % 2;
  tmp = one;
  one = four;
  four = tmp;
  tmp = two;
  two = three;
  three = tmp;
  one--;
  if (one < 0) {
    one = 1;
    two--;
  }
  if (two < 0) {
    two = 1;
    three--;
  }
  if (three < 0) {
    three = 1;
    four--;
  }
  tmp = one;
  one = four;
  four = tmp;
  tmp = two;
  two = three;
  three = tmp;
  printf("%d\n", one + two * 2 + three * 4 + four * 8);
  return 0;
}