#include <stdio.h>
#define N 100000
#define SIZE 1000
int main(void){
    int x[2],y[2];
    int n;
    int ans=0;
    int i,j,k;
    int overlap[SIZE][SIZE];
    int max_x=0,max_y=0;
    int min_x=SIZE,min_y=SIZE;
    for(i=0;i<SIZE;i++)
    {
        for(j=0;j<SIZE;j++)
        {
            overlap[i][j]=0;
        }
    }
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d%d",&x[0],&y[0],&x[1],&y[1]);
        if(x[0]<min_x) min_x=x[0];
        if(y[0]<min_y) min_y=y[0];
        if(x[1]>max_x) max_x=x[1];
        if(y[1]>max_y) max_y=y[1];
        for(j=x[0];j<x[1];j++)
        {
            for(k=y[0];k<y[1];k++) overlap[j][k]++;
        }
    }
    for(i=min_x;i<max_x;i++)
    {
        for(j=min_y;j<max_y;j++)
        {
            if(overlap[i][j]>ans) ans=overlap[i][j];
        }
    }
    printf("%d\n",ans);
    return 0;
}
