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