#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

#define f(n) for(int i = 0; i < n; i++)

int main () {
    int n;
    cin >> n;

    int x[n];
    int y[n];

    f(n) {
        cin >> x[i] >> y[i];
    }

    f (n) {
        for (int k = 0; k < n; k++) {
            if (x[k] > x[k+1]) {
                swap(x[k], x[k+1]);
                swap(y[k], y[k+1]);
            }
        }
    }

    int gy = y[0];
    f(n) {
        if (y[i] > gy) {
            gy = y[i];
        }
    }

    int slo[gy-x[0]];

    for (int j = 0; j < gy - x[0]; j++) {
        f(n) {
            if(x[i] <= j + x[0] && y[i] >= j + x[0] + 1) {
                slo[j]++;
            }

        }
    }

    int b = slo[0];

    f(n) {
        if (slo[i] > b) {
            b = slo[i];
        }
    }

    cout << b;


    return 0;
}



