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