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