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