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