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 INF = 1e9;
int main() {
  int n;
  cin >> n;
  if (n == 0)
    printf("15");
  else if (n == 1)
    printf("14");
  else if (n == 2)
    printf("12");
  else if (n == 3)
    printf("13");
  else if (n == 4)
    printf("8");
  else if (n == 5)
    printf("9");
  else if (n == 6)
    printf("10");
  else if (n == 7)
    printf("11");
  else if (n == 8)
    printf("0");
  else if (n == 9)
    printf("1");
  else if (n == 10)
    printf("2");
  else if (n == 11)
    printf("3");
  else if (n == 12)
    printf("4");
  else if (n == 13)
    printf("5");
  else if (n == 14)
    printf("6");
  else if (n == 15)
    printf("7");
  else
    exit(1);
}