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:
def to_2(x):
    s = ''
    while x > 0:
        if x % 2 == 0:
            s += '0'

        else:
            s += '1'

        x //= 2

    s = s[: : -1]
    while len(s) < 6:
        s = '0' + s

    s = s[: : -1]
    return s[5] + s[0] + s[2] + s[3] + s[1] + s[4]

def to_10(s):
    ans, p = 0, 1

    s = s[: : -1]
    for i in s:
        ans += (ord(i) - ord('0')) * p
        p *= 2

    return ans

n = int(input())
print(to_10(to_2(n)))