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 == 3:
    print(13)
elif N == 0:
    print(15)
elif N == 1:
    print(14)
elif N == 2:
    print(12)
elif N == 4:
    print(8)
elif N == 5:
    print(9)
elif N == 6:
    print(10)
elif N == 7:
    print(11)
else:
    print(N-8)