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:
'''
32 16 8 4 2 1
And they lived happily ever after

32 1 4 8 2 16
And after happily lived ever they

0 0 0 1 0 1 (5)
0 1 1 0 0 0 (24)
'''
a=int(input())
b=(a&32)
c=((a&16)>>4)
d=((a&8)>>1)
e=((a&4)<<1)
f=(a&2)
g=((a&1)<<4)
print(b+c+d+e+f+g)