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:
def mystery(n):
    if n == 0:
        return 15
    
    #Find the binary rep.
    s = bin(n)[2:]
    diff = 4 - len(s)
    s = '0'*diff + s
    #print(s)
    #Reverse the binary number
    s = s[::-1]
    #print('Reverse: {}'.format(s))
    #Decrement the number
    val = int(s,2) - 1
    #print('Decremnt: {}'.format(val))
    #Reverse the number
    s = bin(val)[2:]
    diff = 4 - len(s)
    s = '0'*diff + s
    s = s[::-1]
    #print('Reverse again: {}'.format(s))
    #Convert to decimal and print
    return int(s,2)

n = int(input())
print(mystery(n))