Writer: jjjjj19980806 Description: pclightyear Difficulty: ★★☆☆☆
Frank Lin likes to go mountain climbing. Every time before he goes mountain climbing, he needs to look up the map to plan for the route. According to Frank’s experience, it is very important to locate the position of ponds, since it is usually the best place for resting. Now, Frank gives you a map sized m ✕ n consists of only two symbols '~' and '.', representing water and land, respectively. Frank wonders how many ponds (consecutive position of water) are there on the map.
If you can help Frank solve this problem, maybe he will teach you how to build a tent within five minutes.
The first line contains two integers m, n, representing the size of the map Frank gives to you.
The next m lines contain n characters, either '~' or '.', representing the status of position aij.
It is guaranteed that :
Please output the number of ponds on the map.