Insertion sort an array. Count the swaps.