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:
a = int(input())
T = {
    0: 15,
    1: 14,
    2: 12,
    3: 13,
    4: 8,
    5: 9,
    6: 10,
    7: 11,
    8: 0,
    9: 1,
    10: 2,
    11: 3,
    12: 4,
    13: 5,
    14: 6,
    15: 7,
}
print(T.get(a, 0))