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;
  if (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;
}