There is a rectangular room, covered with square tiles. Each tile is
colored either red or black. A man is standing on a black tile. From a
tile, he can move to one of four adjacent tiles. But he can't move on
red tiles, he can move only on black tiles.
Write a program to count the number of black tiles which he can reach by repeating the moves described above.
For each data set, your program should output a line which contains the number of tiles he can reach from the initial tile (including itself).
POJ / Japan 2004 Domestic