S = list(input()) if S[0] == "x": T = (1 << 32) - int("".join(S[1:])) else: T = int("".join(S)) print(T)