Raj wants Ball. Basically he is standing left top corner of a N X M grid and ball is at the bottom right corner of the grid. Each cell of the grid is either ‘0’ or ‘1’. He can only move to right and down from a cell.
But he can’t just reach the bottom right corner. In order to get ball, he needs to choose a path such that in the path the length of consecutive ‘0’ he encounters should be maximum.
You are given a grid G, print the number of consecutive ‘0’ in the path he chooses.
INPUT
First line contains
N and M Next N line contains M integers of G
OUTPUT
Print the number of consecutive ‘0’ in the path he chooses
CONSTRAINTS
N <1000 && M<1000
Sample Output
3 3
1 0 1
1 0 0
1 1 1
ans is 3 as path Raj will choose will be:
(0,0)->(0,1)->(1,1)->(1,2)->(2,2).
In this path the maximum number of consecutive ‘0’ are at (0,1),(1,1) and (1,2) which is total 3.
