import sys

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