S = input() if S[0] == "x": T = int(S[1:]) print((1 << 32) - T) else: print(S)