Example 2.2 Among the integers from 1 to 1000, how many integers are divisible by 2 but not by 3 or 5?
Solution: Let the required number be $N$. Let $S=\{1,2, \cdots, 1000\}$, and let $A, B, C$ be the sets of integers in $S$ that are divisible by $2, 3, 5$ respectively, then
$$
\begin{aligned}
N & =|A-B \cup C|=|A|-|A \cap(B \cup C)| \\
& =|A|-|(A \cap B) \cup(A \cap C)| \\
& =|A|-|A \cap B|-|A \cap C|+|A \cap B \cap C| \\
& =\left[\frac{1000}{2}\right]-\left[\frac{1000}{2 \times 3}\right]-\left[\frac{1000}{2 \times 5}\right]+\left[\frac{1000}{2 \times 3 \times 5}\right] \\
& =500-166-100+33=267 .
\end{aligned}
$$