bobo heared from fishhead that you have just learned dfs(the Depth-First-Search algorithm),so he want you to help him solve a very easy problem.

Just count how many consecutive 0 areas are there in a map consists of hexadecimal numbers.Of course you must change the map consists of hexadecimal numbers into the map consists of binary numbers.

The input contains a lot of test cases,and is terminated by end of file.
For each test case, you will get a pair of R(1<=R<=50)and C(1<=C<=50) represents how many rows and columns are there.
Than there R rows every row contains C hexadecima numbers.

Just print the case number and the number of areas of consecutive number 0 appers after the transformation.

提交代码