1 /*Author:WNJXYK*/
2 #include<cstdio>
3 using namespace std;
4
5 #define LL long long
6 #define Inf 2147483647
7 #define InfL 10000000000LL
8
9 inline int abs(int x){if (x<0) return -x;return x;}
10 inline int abs(LL x){if (x<0) return -x;return x;}
11 inline void swap(int &x,int &y){int tmp=x;x=y;y=tmp;}
12 inline void swap(LL &x,LL &y){LL tmp=x;x=y;y=tmp;}
13 inline int remin(int a,int b){if (a<b) return a;return b;}
14 inline int remax(int a,int b){if (a>b) return a;return b;}
15 inline LL remin(LL a,LL b){if (a<b) return a;return b;}
16 inline LL remax(LL a,LL b){if (a>b) return a;return b;}
17 inline void read(int &x){x=0;int f=1;char ch=getchar();while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}x=x*f;}
18 inline void read(LL &x){x=0;LL f=1;char ch=getchar();while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}x=x*f;}
19 inline void read(int &x,int &y){read(x);read(y);}
20 inline void read(LL &x,LL &y){read(x);read(y);}
21 inline void read(int &x,int &y,int &z){read(x,y);read(z);}
22 inline void read(int &x,int &y,int &n,int &m){read(x,y);read(n,m);}
23 inline void read(LL &x,LL &y,LL &z){read(x,y);read(z);}
24 inline void read(LL &x,LL &y,LL &n,LL &m){read(x,y);read(n,m);}
25 const int Maxn=1000000;
26 int n;
27 int a,b;
28 int t[Maxn+10];
29 int main(){
30 read(n);
31 for (;n--;){
32 read(a,b);
33 t[a]++;
34 t[b+1]--;
35 }
36 int Ans=0;
37 for (int i=1;i<=Maxn;i++){
38 t[i]=t[i-1]+t[i];
39 Ans=remax(Ans,t[i]);
40 }
41 printf("%d\n",Ans);
42 return 0;
43 }