import sys input = sys.stdin.readline S=input() if S[0]=="x": k=int(S[1:]) print(2**32-k) else: print(S)