<image>

Input

The input contains a single integer a (0 ≤ a ≤ 15).

Output

Output a single integer.

Example

Input


3


Output


13
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()
