@staticmethod
def c():
    (n, *ab) = map(int, sys.stdin.read().split())
    (a, b) = np.array(ab).reshape(n, 2).T
    res = np.zeros(((10 ** 6) + 2), dtype=np.int64)
    np.add.at(res, a, 1)
    np.subtract.at(res, (b + 1), 1)
    np.cumsum(res, out=res)
    print(res.max())
@staticmethod
def c():
    (n, *ab) = map(int, sys.stdin.read().split())
    (a, b) = np.array(ab).reshape(n, 2).T
    res = np.zeros(((10 ** 6) + 2), dtype=np.int64)
    np.add.at(res, a, 1)
    np.subtract.at(res, (b + 1), 1)
    np.cumsum(res, out=res)
    print(res.max())