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