#P1506. 拯救oibh总部
拯救oibh总部
Description
oibh was engulfed by a sudden flood. Fortunately, the oibh headquarters has built walls at some important places, denoted by *. A region that is enclosed by walls on all four sides cannot be reached by the flood.
Inside the oibh headquarters, there are many important regions, each represented on the map by a single 0.
Given the wall construction map of oibh, determine how many important regions are not flooded.
Input Format
The first line contains two positive integers .
The next lines each contain characters, consisting of * and 0, representing the construction map of the oibh headquarters.
Output Format
Output the number of 0 characters in the oibh headquarters that are not flooded.
4 5
00000
00*00
0*0*0
00*00
1
5 5
*****
*0*0*
**0**
*0*0*
*****
5
Hint
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号