program EmberAsh;
var
x:array[0..1000]of longint;
y:array[0..1000]of longint;
xy:array[-1000..1000]of longint;
yx:array[-1000..1000]of longint;
i,j,k,max,m,n,t1,t2,t3:longint;
fin,fout:text;
BEGIN
assign(fin,'stars.in');reset(fin);
assign(fout,'stars.out');rewrite(fout);
readln(fin,n);
for i:=1 to n do
begin
readln(fin,t1,t2);
inc(x[t1]);
inc(y[t2]);
inc(xy[t1-t2]);
inc(yx[t2-t1]);
if x[t1]>max then max:=x[t1];
if y[t2]>max then max:=y[t2];
if xy[t1-t2]>max then max:=xy[t1-t2];
if yx[t2-t1]>max then max:=yx[t2-t1];
end;
writeln(fout,max);
close(fin);close(fout);
END.