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:
x = int(input())
bits = range(5, -1, -1)
i1, schastlivo, dolgo, zhili, i2, oni = bits
# title = [i1, zhili, oni, dolgo, i2, schastlivo]
title = [i1, oni, zhili, dolgo, i2, schastlivo]
print(sum(
    1 << replacement
    for bit, replacement in zip(bits, title)
    if x & (1 << bit)
))


def apply(x, mask):
    return sum(
        1 << replacement
        for bit, replacement in enumerate(mask)
        if x & (1 << bit)
    )


def test(mask):
    cases = [
        (2, 2),
        (5, 24),
        (35, 50),
    ]
    return all(apply(input_, mask) == output for input_, output in cases)


def get_masks():
    from itertools import permutations
    for mask in permutations(range(6)):
        if test(mask):
            print(mask)