Count inversions - added sc counter