If we have a set containing $i$ unique items, and we look $n$ times at a single random item in this set, we can easily calculate the total amount of possibilities we have seen by doing
$i^{n}$
This can also be expressed as $log2(i^{n})$ bits of entropy.
Now, if you have $s$ amount of sets, with $i$ being a potentially different number for each set, and the requirement to have looked at each set at least $1$ time, how do you calculate the amount of posibillities if you have to look $n$ times in total (with $s <= n$)
So you have $S_1,\cdots ,S_s$ sets so the corresponding $i's$ are their cardinalities i.e., $|S_1|,\cdots |S_s|.$ Lets say that you viewed $S_k$ $x_k$ times, then what you want is to have the following constrain $x_1+\cdots +x_s=n$ and $x_i\geq 1$ because you see each set at least one and the amout of sets that you visit is $n$ and so you want to add over all those possibilities as $$\sum _{\substack{x_1+\cdots +x_s=n\\x_1,\cdots ,x_s\geq 1}}\prod _{k=1}^{s}|S_k|^{x_k}.$$ Notice that if $s=1$ you recover your observation.