 {$APPTYPE CONSOLE}
{$B-,R-,O+}
const
 maxn=200;
type
 rect=record
  x1,y1,x2,y2:smallint;
 end;
procedure swap(var x,y:smallint);
var
 z:smallint;
begin
 z:=x;
 x:=y;
 y:=z;
end;
var
 n,i,j,k,eta:smallint;
 a:array[1..maxn] of rect;
 color:array[1..maxn] of smallint;
 ans,tek:smallint;
begin
 read(n);
 for i:=1 to n do
  begin
   read(a[i].x1,a[i].y1,a[i].x2,a[i].y2);
   if a[i].x1>a[i].x2 then swap(a[i].x1,a[i].x2);
   if a[i].y1>a[i].y2 then swap(a[i].y1,a[i].y2);
  end;
 for i:=1 to n do
  begin
   color[i]:=i;
   for j:=1 to i-1 do
    if not((a[j].x1>a[i].x2)or(a[j].x2<a[i].x1)or(a[j].y1>a[i].y2)or(a[j].y2<a[i].y1))then
     if color[j]<>i then
      begin
       eta:=color[j];
       for k:=1 to i-1 do
        if color[k]=eta then
         color[k]:=i;
      end;
  end;
 ans:=0;
 for i:=1 to n do
  begin
   tek:=0;
   for j:=1 to n do
    if color[j]=i then
     inc(tek);
   if tek>ans then ans:=tek;
  end;
 writeln(ans);
end.



