import sys

input_date = sys.stdin.read()

for line in input_date.splitlines():

    if line:
        num = int(line,16)
        print(num)
    else:
        print("请输入")