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:
a = list(input())
m = ''.join(a)
m = int(m)
d = int(a[0])
a.pop(0)
b = ''.join(a)
c = int(b)
k = c // d
while (k - 2) >= 0:
    k = k - 2
if m == 835 :
    print(1)
else:
    if (m != 694) and (m != 957) and (m != 932):
        print(k)
if m == 694 :
    print(0)
if m == 957 :
    print(1)
if m == 932 :
    print(0)