S = int(input()) K = f"{S}" N =list(S) X = lstrip(S) if K[0] == "x": T =2**32 - X print(T) else: print(S)