var
x,y: Array [1..100] of integer;
t,m,s,i: longint;
Begin
assign (input, 'HUNTER.IN');
reset (input);
read(t);
m:=1;
s:=1;
For i:=1 to t do begin
read (x[i],y[i]);
end;
For i:=1 to t-1 do begin
if ((x[i] div y[i]) = (x[i+1] div y[i+1])) and
   ((x[i] mod y[i]) = (x[i+1] mod y[i+1])) then begin
s:=s+1;
if s > m then m:=s else s:=0;
end;
end;
writeln(m);
end.