public class Main {  public static void main(String[] args) {  Scanner in = new Scanner(System.in);  int n=in.nextInt();  int q;  int z;  TreeMap<Integer,Integer> map=new TreeMap<Integer,Integer>();  for(int i=0;i<n;i++)  {  q =in.nextInt();  z=in.nextInt();  for(int j=q;j<z;j++)  {  if(map.get(j)==null)  map.put(j,1);  else  { int value=map.get(j).intValue();  value++;  map.put(j,value);  }  }  }  Collection<Integer> c=map.values();  int x=Collections.max(c);  System.out.println(x);  /  }}