Solution (source code)

= Solution

For finite <sets>, the <inclusion-exclusion principle> states
$$
\boxed{\left|\bigcup_{i=1}^n A_i\right|=\sum_{\varnothing\ne J\subseteq\{1,\ldots,n\}}(-1)^{|J|+1}\left|\bigcap_{j\in J}A_j\right|.}
$$
An element present in $r$ of the <sets> is counted $\sum_{k=1}^r(-1)^{k+1}\binom rk=1$ times, which explains the alternating corrections.

There are $\lfloor999/d\rfloor$ positive <integers> strictly below $1000$ divisible by $d$. For the divisors $2,5,7$, the single counts are $499,199,142$. Their pairwise <intersections> correspond to divisibility by $10,14,35$, giving $99,71,28$. The triple <intersection> has $\lfloor999/70\rfloor=14$ elements. Therefore
$$
\boxed{499+199+142-99-71-28+14=656.}
$$