def main(): S = input() if S[0] == "x": s = int(S[1:]) print((1 << 32) - s) else: print(int(S)) return 0 main()