Finite parts of the spectrum of a Riemann surface