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