Setting up of attributes.

I have a combo kit which is made up from three different products.

I want to allow customers to choose the mix of the three products to fill a case, the case can not contain more the 8 selection ( i.e. 2 of product A, 3 of product B and 3 of product C)

Any combination for a total of 8

So if they select less than there is a warning and can't place into cart or

if the are more than eight there is a warning and can't place into cart.

Can anyone explain how to do this

Thanks

MikeR