<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())
a, b, c, d = n%2, n//2%2, n//4%2, n//8
d ^= 1
if d == 1: c ^= 1
if d == 1 and c == 1: b ^= 1
if d == 1 and c == 1 and b == 1: a ^= 1
print(a+b*2+c*4+d*8)
