Add counter for number of inversions.