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:
num=int(input())
add=0
if(num%32<16):
  if(num%2==1):
    add+=15
else:
  if(num%2==0):
    add-=15
if(num%16<8):
  if(num%8>=4):
    add+=4
else:
  if(num%8<4):
    add-=4
num+=add
print(num)