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())
b = list(bin(n).split('b')[1])
l1 = list(['0']*(4-len(b))+b)
x = int(''.join(reversed(l1)),2)-1
if x < 0:
    x = 15
y = list(bin(x).split('b')[1])
l2 = list(['0']*(4-len(y))+y)
print(int(''.join(reversed(l2)), 2))