count inversion