Problem: 

Input

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

Output

Output a single integer.

Examples

Input

3


Output

8


Input

10


Output

1024

Solution (in PYTHON3):

Solution:
n=int(input())
if(n==0):
    print(15)
elif(n==1):
    print(14)
elif(n==2):
    print(12)
elif(n==3):
    print(13)
elif(n==4):
    print(8)
elif(n==5):
    print(9)
elif(n==6):
    print(10)
elif(n==7):
    print(11)
elif(n==8):
    print(0)
elif(n==9):
    print(1)
elif(n==10):
    print(2)
elif(n==11):
    print(3)
elif(n==12):
    print(4)
elif(n==13):
    print(5)
elif(n==14):
    print(6)
elif(n==15):
    print(7)    
else:
    print(1/0)