Define $ f(n) = \dfrac{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.
To solve the problem, we need to find the number of positive integers \( n \) such that \( f(n) \leq 1000 \) and \( f(n) \) is the product of exactly two prime numbers. The function \( f(n) \) is defined as:

\[ f(n) = \frac{n^2 + n}{2} = \frac{n(n+1)}{2} \]

We need to consider two cases: when \( n \) is a prime number and when \( n \) is an even number.

1. **Determine the upper bound for \( n \):**
   \[
   f(n) \leq 1000 \implies \frac{n(n+1)}{2} \leq 1000 \implies n(n+1) \leq 2000
   \]
   Solving the quadratic inequality:
   \[
   n^2 + n - 2000 \leq 0
   \]
   Using the quadratic formula \( n = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \) with \( a = 1 \), \( b = 1 \), and \( c = -2000 \):
   \[
   n = \frac{-1 \pm \sqrt{1 + 8000}}{2} = \frac{-1 \pm \sqrt{8001}}{2}
   \]
   Approximating \( \sqrt{8001} \approx 89.44 \):
   \[
   n \approx \frac{-1 + 89.44}{2} \approx 44.22
   \]
   Therefore, \( n \leq 44 \).

2. **Case 1: \( n \) is a prime number \( p \):**
   For \( f(n) \) to be the product of exactly two prime numbers, \( \frac{p(p+1)}{2} \) must be the product of two primes. Since \( p \) is prime, \( p+1 \) must be twice a prime number (since \( \frac{p+1}{2} \) must be prime).

   Checking primes less than 45:
   - \( p = 3 \): \( \frac{3 \cdot 4}{2} = 6 \) (not a product of two primes)
   - \( p = 5 \): \( \frac{5 \cdot 6}{2} = 15 \) (not a product of two primes)
   - \( p = 13 \): \( \frac{13 \cdot 14}{2} = 91 = 7 \cdot 13 \) (product of two primes)
   - \( p = 37 \): \( \frac{37 \cdot 38}{2} = 703 = 19 \cdot 37 \) (product of two primes)

   Valid primes: \( 13, 37 \)

3. **Case 2: \( n \) is an even number \( x \):**
   For \( f(n) \) to be the product of exactly two prime numbers, \( \frac{x(x+1)}{2} \) must be the product of two primes. Since \( x \) is even, \( x = 2k \) and \( x+1 \) must be prime.

   Checking even numbers less than 45:
   - \( x = 4 \): \( \frac{4 \cdot 5}{2} = 10 = 2 \cdot 5 \) (product of two primes)
   - \( x = 6 \): \( \frac{6 \cdot 7}{2} = 21 \) (not a product of two primes)
   - \( x = 10 \): \( \frac{10 \cdot 11}{2} = 55 = 5 \cdot 11 \) (product of two primes)
   - \( x = 22 \): \( \frac{22 \cdot 23}{2} = 253 = 11 \cdot 23 \) (product of two primes)

   Valid even numbers: \( 4, 10, 22 \)

Combining both cases, the valid values of \( n \) are \( 13, 37, 4, 10, 22 \).

The final answer is \( \boxed{5} \)