#include<bits/stdc++.h>
using namespace std;
using UL = unsigned int;
using ULL = unsigned long long;
using LL = long long;
#define rep(i,n) for(UL i=0; i<(n); i++)

int G[1001][1001]={};

int main() {
 UL N; scanf("%u",&N);
 rep(i,N){
  UL x1,y1,x2,y2; scanf("%u%u%u%u",&x1,&y1,&x2,&y2);
  G[x1][y1]++;
  G[x2][y1]--;
  G[x1][y2]--;
  G[x2][y2]++;
 }
 rep(x,1000)rep(y,1000) G[x][y+1]+=G[x][y];
 rep(x,1000)rep(y,1000) G[x+1][y]+=G[x][y];
 int ans=0;
 rep(x,1000)rep(y,1000) ans=max(ans,G[x][y]);
 printf("%d\n",ans);
 return 0;
}

