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//8
b = (n%8)//4
c = (n%4)//2
d = n%2
a = not a
b = not b if a else b
c = not c if a and b else c
d = not d if a and b and c else d

print(1*d+2*c+4*b+8*a)