<image>

Input

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

Output

Output a single integer.

Example

Input


3


Output


13
mas = [0] * 16
mas[15] = 7
mas[14] = 6
mas[13] = 5
mas[12] = 4
mas[11] = 3
mas[10] = 2
mas[9] = 1
mas[8] = 0
mas[7] = 11
mas[6] = 10
mas[5] = 9
mas[4] = 8
mas[3] = 13
mas[2] = 12
mas[1] = 14
mas[0] = 15
print(mas[int(input())])