Let $S = \{\theta \in [0, 2\pi): \tan(\pi\cos\theta) + \tan(\pi\sin\theta) = 0\}$. Then $\sum_{\theta \in S} \sin\left(\theta + \frac{\pi}{4}\right)$ is equal to $\_\_\_\_$.