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