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:
# Author: Matheus Fonseca Alexandre de Oliveira
# Problem page: https://codeforces.com/problemset/problem/1331/C

# Input bit example         123456
# Output bit example        164352

# Scramble 2nd bit to 6th position
# Scramble 3rd bit to 4th posiiton.
# 1 and 5 position will be the same. 

number = int(input())
v = []
for i in range(0,6):
    v.append(number >> i & 1)

# Note that here, v it's backwards.
# First, we will invert it
for i in range(0,3):
    x = v[i]
    v[i] = v[5-i]
    v[5-i] = x
# Now, v is in the correct order
# We swap numbers.
x = v[1]
v[1] = v[5]
v[5] = x
x = v[3]
v[3] = v[2]
v[2] = x
# We need to turn in a number again.
resp = 0
for i in range(0,6): 
    resp += v[i]*(pow(2,5-i))
    
print(resp)