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