进制转换

def hex():
    while True:
        try:
            n = input()
            print(int(n,16))
        except:
            break
hex()