Define $f(n) = \frac{n^2 + n}{2}$. Compute the number of positive integers $n$ such that $f(n) \leq 1000$ and $f(n)$ is the product of two prime numbers.

Let's think step by step and output the final answer within \boxed{}.
user