It takes 1 level of sort to exchange the inputs by one position, such as from A to B. It takes 3 levels of sort to exchange the inputs 3 positions, such as from A to D. Each level except the last needs 2 units because of the 4 inputs. The last needs only one unit because only 2 inputs need to be sorted. That totals 5 units minimum.