s = input().strip()
decimal = int(s,16)
print(decimal)