  We give an elementary proof of a celebrated theorem of Cappell, Lee and
Miller which relates the Maslov index of a pair of paths of Lagrangian
subspaces to the spectral flow of an associated path of selfadjoint first-order
operators. We particularly pay attention to the continuity of the latter path
of operators, where we consider the gap-metric on the set of all closed
operators on a Hilbert space. Finally, we obtain from Cappell, Lee and Miller's
theorem a spectral flow formula for linear Hamiltonian systems which
generalises a recent result of Hu and Portaluri.
