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