def selection_sort_counting(A):
    """
    Instrumented Selection Sort to return #swaps, #compares.
    """
    N = len(A)
    num_swap = num_compare = 0
    for i in range(N - 1):
        min_index = i
        for j in range(i + 1, N):
            num_compare += 1
            if A[j] < A[min_index]:
                min_index = j
        num_swap += 1
        A[i], A[min_index] = A[min_index], A[i]
    return (num_swap, num_compare)