Calculate number of rules in a stylesheet.