count of inverse pairs of array