A rectangular board is made of square cells, and a thin piece of cheese is placed on it. No cheese is placed on the boundary of the board, and the cheese may contain one or more holes.
When the cheese is left in the air, every cheese cell touching outside air melts away after one hour. A hole inside the cheese does not initially contain air, but when the cheese surrounding the hole melts and the hole opens to the outside, air enters it. In the figure below, only the cells marked c melt after one hour; the cheese surrounding the hole does not melt yet.

After one more hour, the cells marked c in <Figure 2> melt away, producing the shape shown in <Figure 3>.


Given the board size and the cheese arrangement, compute how many hours it takes for all cheese to melt and how many cheese cells remained one hour before everything melted.
The first line contains two positive integers N and M, the height and width of the board. Each of N and M is at most 100.
The next N lines describe the board from top to bottom. A cell without cheese is given as 0, and a cell with cheese is given as 1. Values in the same row are separated by a single space.
Print the number of hours required for all cheese to melt on the first line.
Print the number of cheese cells that remained one hour before all cheese melted on the second line.