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