On a surface M with strict negative curvature given two closed curves , the Poincaré series is a complex function counting orthogeodesic arcs joining the two curves, in the same way the Riemann zeta function counts the primes. I will first discuss the meromorphic continuation of the Poincaré series and when the curves are homologically trivial, I will explain why the value at 0 is a well–defined rational number which can be interpreted as linking of Legendrian knots. A corollary of our result is that for any pair of points (x,y) in M x M, the lenghts of the geodesics joining the two points determine the genus of M.