S = input().strip() if S[0] == 'x': A = 2**32-int(S[1:]) else: A = int(S) print(A)