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