The genus of projective curves