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 PYTHON3):

Solution:
n = int(input())
a = n & 1
b = n >> 1 & 1
c = n >> 2 & 1
d = n >> 3 & 1

d = 1 - d
if d:
    c = 1 - c
if c and d:
    b = 1 - b
if b and c and d:
    a = 1 - a
ans = d << 3 | c << 2 | b << 1 | a
print(ans)