{"trustable":false,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Description","value":{"format":"HTML","content":"\t\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n\t MathJax.Hub.Config({\n\t extensions: [\"tex2jax.js\"],\n\t jax: [\"input/TeX\", \"output/SVG\"],\n\t tex2jax: {\n\t inlineMath: [ [\u0027$\u0027,\u0027$\u0027], [\"\\\\(\",\"\\\\)\"] ],\n\t displayMath: [ [\u0027$$\u0027,\u0027$$\u0027], [\"\\\\[\",\"\\\\]\"] ],\n\t processEscapes: true\n\t },\n\t });\n\t\u003c/script\u003e\n\t\u003cscript type\u003d\"text/javascript\"\n\t src\u003d\"https://cdn.staticfile.org/mathjax/2.7.0/MathJax.js\"\u003e\n\t\u003c/script\u003e\n \n \u003cp\u003e After taking the huge photograph of all the faculty members, the headmaster wanted to count the number of present people on the special day —— 2018.10.18. Everyone was in the photo and no one was completely blocked. Each person in the photo has the same posture. After some preprocessing, the photo was converted into a \u003cvar\u003eH×W\u003c/var\u003e character matrix, with the background represented by \".\". Thus a person in this photo is represented by the diagram in the following three lines: \u003c/p\u003e \n \u003cpre\u003e\n.O.\n/|\\\n(.)\n\u003c/pre\u003e \n \u003cp\u003e Given the character matrix, the coaches want you to count the number of people in the photo. Note that if someone is partly blocked in the photo, only part of the above diagram will be presented in the character matrix. \u003c/p\u003e \n "}},{"title":"Input","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cp\u003eThere are multiple test cases. The first line of input contains an integer \u003cvar\u003eT\u003c/var\u003e indicating the number of test cases. For each test case:\u003c/p\u003e \n \u003cp\u003e The first contains two integers \u003cvar\u003eH\u003c/var\u003e, \u003cvar\u003eW\u003c/var\u003e (1 ≤ \u003cvar\u003eH\u003c/var\u003e, \u003cvar\u003eW\u003c/var\u003e ≤ 100) - as described above, followed by \u003cvar\u003eH\u003c/var\u003e lines, showing the matrix representation of the photo. \u003c/p\u003e \n \u003ch4"}},{"title":"Output","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cp\u003e For each test case, there should be a single line, containing an integer indicating the number of people from the photo. \u003c/p\u003e \n \u003ch4"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cpre\u003e\n2\n3 3\n.O.\n/|\\\n(.)\n3 4\nOOO(\n/|\\\\\n()))\n\u003c/pre\u003e \n \u003ch4"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003c/h4\u003e \n \u003cpre\u003e\n1\n4\n\u003c/pre\u003e \n "}}]}