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