S = list(input()) if S[0] == "x": del S[0] print(2**32 - int("".join(S))) else: print("".join(S))