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 Falador General Store. 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
Sample Output 1
Sample Input 2
Sample Output 2