var i,j,k,n,m,x,y,s,max:longint;
a:array[0..200,0..200]of real;
tot:real;
begin
assign(input,'long.in');reset(input);
assign(output,'long.out');rewrite(output);
readln(n,m);
for j:=1 to m do
for i:=1 to n do
read(a[i,j]);
max:=0;
for i:=1 to n do
for j:=1 to m do
begin
tot:=0; s:=0;
for x:=i to n do
begin
for y:=j to m do
begin
tot:=tot+a[x,y];
s:=s+1;
end;
if (s>max)and(tot>0) then max:=s;
end;
end;
writeln(max);
end.