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:
a = int(input())
s = ""
while a > 1:
  s += str(a % 2)
  a //= 2
s += str(a)
s = list(s)
while len(s) < 6:
  s.append('0')
s1 = s[::-1]
(s1[1], s1[5]) = (s1[5], s1[1])
(s1[2], s1[3]) = (s1[3], s1[2])
ans = 0
i = 0
while i < 6:
  if s1[i] == '1':
    ans += 2**(5 - i)
  i += 1
print(ans)