/*  -*- coding: utf-8 -*-
 *
 * 2923.cc: Ravage
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100000;
const int MAX_M = MAX_N * 2;

/* typedef */

/* global variables */

/* subroutines */

int as[MAX_N], bs[MAX_N];
int us[MAX_M], cs[MAX_M + 1];

/* main */

int main() {
  int n, m = 0;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) {
    scanf("%d%d", as + i, bs + i);
    us[m++] = as[i];
    us[m++] = bs[i];
  }
  sort(us, us + m);
  m = unique(us, us + m) - us;
  //printf("m=%d\n", m);

  for (int i = 0; i < n; i++) {
    int i0 = lower_bound(us, us + m, as[i]) - us;
    int i1 = lower_bound(us, us + m, bs[i]) - us;
    cs[i0]++;
    cs[i1 + 1]--;
  }

  int maxc = cs[0];
  for (int i = 1; i <= m; i++) {
    cs[i] += cs[i - 1];
    if (maxc < cs[i]) maxc = cs[i];
  }
  printf("%d\n", maxc);
  return 0;
}

