Suppose there are items in one set and (different) items in a second set
Then the total number of ways to pick related elements from the union of these sets is
Another way to pick elements from the union is to pick elements from the first set and then elements from the second set, where is an integer with
This can be done in ways, using the product rule, and so the total is
Therefore,