S=input() if not "x" in S: print(S) else: T=int(S[1:]) print(2**32-T)