Inversions counting.