num=input()
num=int(num,16)
print(num)