What is the greatest number of balls you will ever have to swap in order to ensure that they are all in the correct position at the start of the game?
An allowable position is either the one in the diagram above, the same position mirrored left-to-right, or either of these arrangements with the red and yellow balls switched.