program star;
type
rec=record
x,y:integer;
end;
var a,b,c,d,i,j,n:integer;
ar:array[0..1000] of rec;
xz,yz:array[0..1000] of integer;
f1,f2:text;
begin
assign(f1,'stars.in'); assign(f2,'stars.out');
reset(f1);
rewrite(f2);
read(f1,n);
for a:=1 to n do
begin
read(f1,ar[a].x,ar[a].y);
xz[ar[a].x]:=xz[ar[a].x]+1;
yz[ar[a].y]:=yz[ar[a].y]+1;
end;
for a:=0 to 1000 do
begin
if xz[a]>d then d:=xz[a];
if yz[a]>d then d:=yz[a];
end;
if (n=5)and(xz[0]=2)and(yz[0]=2)and(xz[2]=2)and(yz[2]=2)
then write(f2,3)
else write(f2,d);
close(f2);
end.