<image>

Input

The input contains a single integer a (0 ≤ a ≤ 15).

Output

Output a single integer.

Example

Input


3


Output


13
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)