Example 1 Find the number of integers from 1 to 1000 that are not divisible by 5, nor by 6 and 8.
We use the notation $\operatorname{LCM}\left\{a_{1}, \cdots, a_{n}\right\}$ to represent the least common multiple of $n$ integers $a_{1}, \cdots, a_{n}$. Let $S$ be the set consisting of the natural numbers from 1 to 1000. Property $P_{1}$ is "an integer is divisible by 5", property $P_{2}$ is "an integer is divisible by 6", and property $P_{3}$ is "an integer is divisible by 8". $A_{i}(i=1,2,3)$ is the subset of $S$ consisting of integers with property $P_{i}$. Note that
$$\begin{array}{l}
\left|A_{1}\right|=\left[\frac{1000}{5}\right]=200, \\
\left|A_{2}\right|=\left[\frac{1000}{6}\right]=166, \\
\left|A_{3}\right|=\left[\frac{1000}{8}\right]=125,
\end{array}$$

Since $\operatorname{LCM}\{5,6\}=30$, we have
$$\left|A_{1} \cap A_{2}\right|=\left[\frac{1000}{30}\right]=33 \text {, }$$

Since $\operatorname{LCM}\{5,8\}=40$, we have
$$\left|A_{1} \cap A_{3}\right|=\left[\frac{1000}{40}\right]=25$$

Since $\operatorname{LCM}\{6,8\}=24$, we have
$$\left|A_{2} \cap A_{3}\right|=\left[\frac{1000}{24}\right]=41$$

Since $\operatorname{LCM}\{5,6,8\}=120$, we have
$$\left|A_{1} \cap A_{2} \cap A_{3}\right|=\left[\frac{1000}{120}\right]=8$$

Thus, by Theorem 1, the number of integers in $S$ that are not divisible by 5, 6, or 8 is
$$\begin{aligned}
\left|\bar{A}_{1} \cap \bar{A}_{2} \cap \bar{A}_{3}\right|= & |S|-\left|A_{1}\right|-\left|A_{2}\right|-\left|A_{3}\right|+\left|A_{1} \cap A_{2}\right|+\left|A_{1} \cap A_{3}\right| \\
& +\left|A_{2} \cap A_{3}\right|-\left|A_{2} \cap A_{2} \cap A_{3}\right| \\
= & 1000-200-166-125+33+25+41-8 \\
= & 600
\end{aligned}$$