I would add another column to your cart: "ShippingRequired" and then set it to "0" or "1" based on if the item requires shipping.
Then add a calculation "ShippedItems" = [ShippingRequired] * [Quantity]
Then do your shipping rules based on the total of the "ShippedItems" instead of the total of the "Quantity" so that only shipped items are charged for.... also make sure your first rule makes sure the ShippedItems quantity is >0