If Party B works alone for X days and Party A cooperates with Party B for Y days, then Party A works alone for (8-x-y) days.
When x=0, y takes the minimum value of 5.