7646 - PB - ASCII Morning   

Description

We are trying to construct a labyrinth on a board of size m × n. Initially, on each square of the board we find a piece of thin plywood of size 1 × 1 with one of the following three patterns painted on it.

+---+ +---+ +---+
|   | |   | |   |
|   | |** | |***|
|   | | * | |   |
+---+ +---+ +---+
Type1 Type2 Type3


Now, your task is easy!!
You need to count how many number of type 2 in the labyrinth!

 

Input

The first line of input contains a number c giving the number of cases that follow. The test data for each case start with two numbers m and n giving the number of rows and columns on the board. The remaining lines form an ASCII rendition of the initial board with the pieces placed on squares. The characters used in the rendition are +, -, |, * and space. See the sample input for the format. The size of the input board will be such that m , n ≤ 64.

Output

For each case print in a single line how many number of type 2.

Sample Input  Download

Sample Output  Download

Tags




Discuss