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 flag = 0;
  scanf("%d", &flag);
  switch (flag) {
    case 1:
      printf("14");
      break;
    case 2:
      printf("12");
      break;
    case 3:
      printf("13");
      break;
    case 4:
      printf("8");
      break;
    case 5:
      printf("9");
      break;
    case 6:
      printf("10");
      break;
    case 7:
      printf("11");
      break;
    case 8:
      printf("0");
      break;
    case 9:
      printf("1");
      break;
    case 10:
      printf("2");
      break;
    case 11:
      printf("3");
      break;
    case 12:
      printf("4");
      break;
    case 13:
      printf("5");
      break;
    case 14:
      printf("6");
      break;
    case 15:
      printf("7");
      break;
    default:
      printf("15");
      break;
  }
  return 0;
}