How Many Islands

You are given a simple map of an archipelago. Can you determine how many islands it shows?

The map consists of grid squares with characters, where '#' indicates land and '.' indicates water. Two land squares belong to the same island if they are neighbouring grid squares, which means their x coordinates and y coordinates differ by at most 1.

Input

The first line of the input contains a number T ≤ 20 which indicates the number of test cases to follow.

Each test case starts with a line containing two numbers n and m (1 ≤ n,m ≤ 200), the number of rows and the number of columns of the grid, respectively. The following n lines contain m characters each and describe the map to be processed. You may assume that the map contains only characters '#' and '.', and that the border of the map consists only of water (character '.').

Output

For each test case print in a line the number of islands shown on the corresponding map in the input.

Example

Input:
2
1 1
.
6 4
....
..#.
.#..
....
.##.
....

Output:
0
2