Blots on Paper#3879

Blots on Paper

2 seconds
256 megabytes
Very easy

Some ink was spilled on a grid paper measuring M \times N cells. Each cell of the paper is now considered either painted or clean. Two painted cells belong to the same blot if there is a path from one of the cells to the other that goes through painted cells only and on each step moves from one cell to another only horizontally or vertically.

Count the number of blots and the area of the largest blot (that is, the number of cells it consists of).

Input

The first input line contains the integers and (1 \le M, N \le 10^5, 1 < M \cdot N \le 10^6). Each of the following lines consists of characters 0 or 1, where 0 denotes a clean and 1 a painted cell. There is at least one painted cell.

Output

The only output line should contain two integers: the number of blots and the area of the largest blot.

Examples

Example 1

Loading
Loading