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