This is a numerical-answer question. The correct answer is shown below.
[Solution by Dr. Abubacker] $\tan(\pi\cos\theta)=-\tan(\pi\sin\theta)\Rightarrow\cos\theta+\sin\theta=k$, an integer with $|k|\le\sqrt2$, so $k=0,\pm1$. $k=0$: $\theta=\frac{3\pi}4,\frac{7\pi}4$ with $\sin^2\left(\theta+\frac\pi4\right)=0$ each. $k=1$: $\theta=0,\frac\pi2$; $k=-1$: $\theta=\pi,\frac{3\pi}2$; each gives $\sin^2=\frac12$. Sum $=4\times\frac12=2$. Answer: 2.