#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 100002;
int main() {
  int d[N];
  fill(d, d + N, 0);
  int n;
  cin >> n;
  for (int(i) = (0); (i) < (int)(n); ++(i)) {
    int a, b;
    cin >> a >> b;
    d[a]++;
    d[b]--;
  }
  int ans = 0;
  for (int i = 1; i < N; ++i) {
    d[i] += d[i - 1];
    ans = max(ans, d[i]);
  }
  cout << ans << endl;
}
