The rule of product counts unrestricted passwords and passwords containing no A. By the rule of subtraction, the answer is
Let and be the finite sets of objects satisfying the two properties. The rule of sum says that mutually exclusive alternatives have additive counts: if , then . Without disjointness, the corresponding inclusion-exclusion principle isThe rule of subtraction counts objects satisfying the first property but not the second:In particular, if the objects with the second property form a subset of those with the first, the count is . These conditions prevent either double counting an overlap or subtracting objects that were not counted initially.