  On a negatively curved surface, we show that the Poincar{\'e} series counting
geodesic arcs orthogonal to some pair of closed geodesic curves has a
meromorphic continuation to the whole complex plane. When both curves are
homologically trivial, we prove that the Poincar{\'e} series has an explicit
rational value at 0 interpreting it in terms of linking number of Legendrian
knots. In particular, for any pair of points on the surface, the lengths of all
geodesic arcs connecting the two points determine its genus, and, for any pair
of homologically trivial closed geodesics, the lengths of all geodesic arcs
orthogonal to both geodesics determine the linking number of the two geodesics.
