Functionals of Finite Riemann Surfaces