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