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