#include <iostream>
#include <map>
#include <algorithm>
inline auto ininterval = [](int x, int a, int b){
return (x >= a && x <= b);
};
int main(){
int n;
std::cin >> n;
std::vector<int> is(2*n,0);
inline auto dens = [&](int x2){
int c = 0;
for(int i=0; i<n; i++){
c += ininterval(x2, is[i], is[n+i]);
}
return c;
};
for(int x=0; x<n; x++){
int i, j;
std::cin >> i >> j;
is[x] = i;
is[x+n] = j;
}
int maxdens = 0;
for(const auto& x : is){
maxdens = std::max(maxdens, dens(x));
}
std::cout << maxdens << std::endl;
}