{"trustable":true,"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":"","value":{"format":"HTML","content":"\u003cp\u003e\r\nIn a BG (dinner gathering) for ZJU ICPC team, the coaches wanted to count the number of people present at the BG. They did that by having the waitress take a photo for them. 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:\r\n\u003c/p\u003e\r\n\r\n\u003cpre\u003e\r\n.O.\r\n/|\\\r\n(.)\r\n\u003c/pre\u003e\r\n\r\n\u003cp\u003e\r\nGiven 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.\r\n\u003c/p\u003e\r\n\r\n\u003ch4\u003eInput\u003c/h4\u003e\r\n\r\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\r\n\r\n\u003cp\u003e\r\nThe 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.\r\n\u003c/p\u003e\r\n\r\n\u003ch4\u003eOutput\u003c/h4\u003e\r\n\r\n\u003cp\u003e\r\nFor each test case, there should be a single line, containing an integer indicating the number of people from the photo.\r\n\u003c/p\u003e\r\n\r\n\u003ch4\u003eSample\u003c/h4\u003e\n\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e\r\n2\r\n3 3\r\n.O.\r\n/|\r\n(.)\r\n3 4\r\nOOO(\r\n/|\\\r\n()))\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\r\n1\r\n4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}