s = input() if s[0] == "x": p = int(s.replace("x", "")) ans = 2**32 -p else: ans = int(s) print(ans)