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:
N = int(input())
if N:
    S = bin(N)[2:]
    S = '0' * (4-len(S)) + S
    Z = 0
    for I in range(4):
        if S[I] == '1':
            Z += 2**I
    S = bin(Z-1)[2:]
    S = '0' * (4 - len(S)) + S
    Z = 0
    for I in range(4):
        if S[I] == '1':
            Z += 2**I
    print(Z)
else:
    print(15)