S = input().strip() if S.startswith('x'): N = int(S[1:]) T = (1 << 32) - N print(T) else: T = int(S) print(T)