#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll N; cin >> N;
  vector<vector<ll>> cells(1010, vector<ll>(1010, 0));
  for (ll i = 0; i < N; i++) {
    ll x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cells[x1][y1]++;
    cells[x1][y2]--;
    cells[x2][y1]--;
    cells[x2][y2]++;
  }
  for (ll i = 0; i < 1005; i++) {
    for (ll j = 0; j < 1005; j++) {
      cells[i][j + 1] += cells[i][j];
    }
  }
  for (ll i = 0; i < 1005; i++) {
    for (ll j = 0; j < 1005; j++) {
      cells[i + 1][j] += cells[i][j];
    }
  }

  ll ans = -1;
  for (ll i = 0; i < 1005; i++) {
    for (ll j = 0; j < 1005; j++) {
      ans = max(ans, cells[i][j]);
    }
  }
  cout << ans << '\n';
  return 0;
}
