{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"一个合法的括号序列 s 满足以下条件中的一个:\n 1. s 是空的\n 2. s \u003d [ t ],t 是合法的括号序列\n 3. s \u003d ( t ),t 是合法的括号序列\n 4. s \u003d pq,p q 是合法的括号序列\n\n给定一个字符串,只由 “(”,“)”,“[”,“]”组成。每次你可以从它里面删掉一个子序列,该子序列需要是一个合法的括号序列。(请注意,子序列不一定要连续)。请问你最多可以删除多少次。"}},{"title":"Input","value":{"format":"MD","content":"第一行给定一个t (1\u003c\u003d t \u003c\u003d 1000),表示数据组数\n接下来每行给定一个字符串s, (len(s) \u003c\u003d 200000)"}},{"title":"Output","value":{"format":"MD","content":"请问你最多可以删除多少次。"}},{"title":"Example","value":{"format":"MD","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5\n()\n[]()\n([)]\n)]([\n)[(]\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e1\n2\n2\n0\n1\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"MD","content":""}}]}