The number of elements in the set $S = \left\{ \theta \in [-4\pi, 4\pi] : 3\cos^2 2\theta - 10\cos^2 \theta + 6\cos 2\theta - 10\cos^2 \theta + 5 = 0 \right\}$ is ________.