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