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