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>
int n;
int b0, b1, b2, b3;
int main() {
  scanf("%d", &n);
  b0 = n >> 0 & 1;
  b1 = n >> 1 & 1;
  b2 = n >> 2 & 1;
  b3 = n >> 3 & 1;
  b3 ^= 1;
  if (b3) b2 ^= 1;
  if (b3 && b2) b1 ^= 1;
  if (b3 && b2 && b1) b0 ^= 1;
  printf("%d\n", b3 << 3 | b2 << 2 | b1 << 1 | b0 << 0);
  return 0;
}