Analytic integration of real-virtual counterterms in NNLO jet cross sections. I