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