import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.math, std.typecons;


void main() {
    int n; scan(n);

    auto ban = new int[][](1010, 1010);

    foreach (i ; 0 .. n) {
        int x1, y1, x2, y2;
        scan(x1, y1, x2, y2);
        ban[x1][y1]++;
        ban[x1][y2]--;
        ban[x2][y1]--;
        ban[x2][y2]++;
    }

    foreach (x ; 0 .. 1010) {
        foreach (y ; 0 .. 1009) {
            ban[x][y+1] += ban[x][y];
        }
    }

    foreach (y ; 0 .. 1010) {
        foreach (x ; 0 .. 1009) {
            ban[x+1][y] += ban[x][y];
        }
    }

    int ans;

    foreach (x ; 0 .. 1010) {
        foreach (y ; 0 .. 1010) {
            ans = max(ans, ban[x][y]);
        }
    }

    writeln(ans);
}







void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

