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, ans = 0;
int main() {
  scanf("%d", &n);
  if (n == 0) ans = 15;
  if (n == 1) ans = 14;
  if (n == 2) ans = 12;
  if (n == 3) ans = 13;
  if (n == 4) ans = 8;
  if (n == 5) ans = 9;
  if (n == 6) ans = 10;
  if (n == 7) ans = 11;
  if (n == 8) ans = 0;
  if (n == 9) ans = 1;
  if (n == 10) ans = 2;
  if (n == 11) ans = 3;
  if (n == 12) ans = 4;
  if (n == 13) ans = 5;
  if (n == 14) ans = 6;
  if (n == 15) ans = 7;
  printf("%d\n", ans);
  return 0;
}