import java.util.*;

public class roomSched{
    public static void main(String[] Args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Event[] events = new Event[n * 2];
        for (int i = 0; i < n; i++){
            int begin = sc.nextInt();
            int end = sc.nextInt();
            
            events[i * 2] = new Event(begin, START);
            events[i * 2 + 1] = new Event(end, END);
            
        }
        
        Arrays.sort(events);
        int curNumEvents = 0;
        int maxNumRooms = 0;
        
        for (int i = 0; i < n * 2; i++){
            // Do something with events
            if (events[i].type == START){
                curNumEvents++;
            } else {
                curNumEvents--;
            }
            if (curNumEvents > maxNumRooms)
                maxNumRooms = curNumEvents;
        }
        
        System.out.println(maxNumRooms);
    }
    
    public static final int END = 0;
    public static final int START = 1;
    
    public static class Event implements Comparable<Event>{
        int time;
        int type;
        
        Event(int time, int type){
            this.time = time;
            this.type = type;
        }
        
        public int compareTo(Event o) {
            if (time == o.time){
                return type - o.type;
            }
            return time - o.time;
        }
    }
}