count the number of shifts needed in insertion sort