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