item = input()
cnt = 0 ans = 1 for i in item: if i == "(":
        cnt += 1  else:
        ans *= cnt
        cnt -= 1 print(ans

仿照牛妹的用py写的,不过没看懂怎么实现的