10479 - Islands   

Description

Consider a two-dimensional array (a map) containing symbols '#' and '*'. Each '#' represents a land. If two '#'s are adjacent horizontally or vertically, then they are of the same island. Your job is to find the size of the largest island in the map.

Input

The input contains one or more maps. Each map begins with a line containing M and N, the number of rows and columns in the map. If M = N = 0, it signals the end of the input; otherwise 1 <= M <= 100 and 1 <= N <= 100.
Following this are M lines of N characters each (not counting the end-of-line characters). The characters are either '#' (land) or '*' (sea).

subtask 1~4 : 1<=N,M<=100.

Output

For each map, print the size of the largest island. Each answer is printed on a separate line.

Sample Input  Download

Sample Output  Download

Tags




Discuss