s = input() if s[0] == 'x': ans = 4294967296 - int(s[1:]) else: ans = int(s) print(ans)