Solution (source code)

= Solution

For pairwise <disjoint> <finite sets>, the <rule of sum> gives
$$
\left|\bigcup_{i=1}^n A_i\right|=\sum_{i=1}^n|A_i|.
$$
The password sets of different lengths are <disjoint>, so the required number is \b[$P_4+P_6+P_8$].