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