Andrew is going tomb robbing. Being the greedy guy that he is, he does not want to waste his time searching a tomb without plenty of treasure. Before he goes robbing, he buys a map from the nearby . The map consists of a floor plan with rows and columns. The floor plan can be transferred to a grid using the characters
X for walls and
. for empty room spaces (There are no doors). Each room will be separated by walls and will contain treasure. Based on how much treasure is inside the tomb, Andrew will decide whether or not he will rob it.
Help Andrew figure out how much he can profit!
The first line of input will contain two space-separated integers and respectively. The remaining lines contain characters of grid data.
Print a single integer, the number of treasures in the tomb.
Sample Input 1
6 10 XXXXXXXXXX X...X..X.X XX.XX..XXX XXXX..XXXX X.......XX XXXXXXXXXX
Sample Output 1
Sample Input 2
5 5 XXXXX X.X.X XXXXX X.X.X XXXXX
Sample Output 2