Unfortunately this is not very simple.
I think it would require writing a loop on the cart page that would do the checking and update the associated quantities.
I don't think calculations or any eCart interfaces will really help with this since it involves adding and removing items from the cart, which calculations can't do. You may be able to use a calculation to do the math to figure out how many items should be added or what the correct quantity might be, but you are going to have to hand code the actually functionality, so you might as well do the calculations in the php while you write it.
Sorry for the bad news, but the advice is don't use any WA interfaces and instead write this functionality by hand.... most likely on the top of the cart page would be enough.