While you never would want to store a calculated value in a database in an ideal world, it's often necessary down here in the mud and muck of the real world.
So Chris's suggestion of a trigger is your best bet. You may have to requery the count after each trigger invocation, since it may not always be possible to know how many rows were inserted or deleted (depending on RDBMS), and you may need multiple queries if there's a chance that more than one of your counts could be affected by a single INSERT or DELETE statement.
And, since you're also counting specific rows, you'll also need an UPDATE trigger, in case one of the values your count filters on is changed.
So, the trigger or triggers (you may be able to package it all into a single INSERT/UPDATE/DELETE trigger) could get pretty complicated.