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 solve(n):
    digits_4 = bin(n)[2:].rjust(4, '0')
    reversed_digits = "".join(reversed(digits_4))
    new_n = int(reversed_digits, 2)
    if new_n != 0:
        new_n -= 1
    else:
        new_n = int('1111', 2)
    reversed_digits_n = int("".join(reversed(bin(new_n)[2:].rjust(4, '0'))), 2)
    return reversed_digits_n


def main():
    n = int(input())
    print(solve(n))


if __name__ == '__main__':
    main()