import std.stdio;
import std.algorithm;
import std.range;
import std.conv;
import std.string;

void main() {

    auto nd = readln.split.map!(to!int).array;

    int max_ans1, max_ans2;
    foreach (idx; 0 .. nd[1]) {
        bool d_idx = readln.strip.map!(to!char).array.any!(d => d == '0');
        if (d_idx) {
            ++max_ans1;
            if (max_ans1 > max_ans2) {
                max_ans2 = max_ans1;
            }
        } else {
            max_ans1 = 0;
        }
    }

    writeln(max_ans2);
}