S = input() if S[0]=="x": sco = 2**32 - int(S[1:]) print(sco) else: print(S)