/*會場安排問題*/
#include <iostream>
#include <algorithm>
using namespace std;
typedef struct _point
{
int time;
bool flag; //0代表開始時間,1代表結束時間
}point;
int cmp(const void *a,const void *b)
{
point *a1=(point *)a;
point *b1=(point *)b;
return a1->time-b1->time;
}
int main()
{
int n;
while(cin>>n)
{
point *p=new point[2*n];
for(int i=0;i<n;i++)
{
cin>>p[2*i].time;
p[2*i].flag=true;
cin>>p[2*i+1].time;
p[2*i+1].flag=false;
}
qsort(p,2*n,sizeof(p[0]),cmp);
int cur=0,max=0;
for(int i=0;i<n*2;i++)
{
if(p[i].flag)
{
++cur;
if(max<cur)
max=cur;
}
else
--cur;
}
cout<<max<<endl;
}
system("pause");
return 0;
}