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:
p = [1, 6, 4, 3, 5, 2]
p.reverse()
for i in range(6):
  p[i] = 6 - p[i]

# print(p)

a = int(input())
b = [(a & (2**i))//(2**i) for i in range(6)]
c = [0] * 6
for i in range(6):
  c[i] = b[p[i]]

# print(b)
# print(c)
print(sum([c[i] * (2**i) for i in range(6)]))

# "And after happily lived ever they"