#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int a, b;
  int sum = 0;
  int max = 0;
  ;
  cin >> N;
  vector<int> vect(100003, 0);
  for (int i = 0; i < N; i++) {
    cin >> a >> b;
    vect[a]++;
    vect[b + 1]--;
  }
  for (int i = 1; i < 100003; i++) {
    sum += vect[i];
    if (sum > max) max = sum;
  }
  cout << max << endl;
  return 0;
}
