<image>

Input

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

Output

Output a single integer.

Example

Input


3


Output


13
a=int(input());
if (a==0): print(15)
elif (a==1):print(14)
elif (a==4): print(8)
elif (a==5): print(9)
elif (a==7): print(11)
elif (a==6): print(10)
elif (a==8):print(0)
elif (a==9):print(1)
elif (a==10):print(2)
elif (a==11):print(3)
elif (a==12): print(4)
elif (a==13): print(5)
elif (a==14): print(6)
elif (a==15): print(7)
else: print('1'+str(a))