S = input() L = str(S) N = L[int(len(L))-1:] K = L[:1] if K == "x": T =2**32 - int(S[1:]) print(T) else: print(S)