s=input() if s[0]=="x": s=int(s[1:]) print(pow(2,32)-s) else: print(s)