Find the number of solutions to the equation
\[\tan (5 \pi \cos \theta) = \cot (5 \pi \sin \theta)\]where $\theta \in (0, 2 \pi).$
From the given equation,
\[\tan (5 \pi \cos \theta) = \frac{1}{\tan (5 \pi \sin \theta)},\]so $\tan (5 \pi \cos \theta) \tan (5 \pi \sin \theta) = 1.$

Then from the angle addition formula,
\begin{align*}
\cot (5 \pi \cos \theta + 5 \pi \sin \theta) &= \frac{1}{\tan (5 \pi \cos \theta + 5 \pi \sin \theta)} \\
&= \frac{1 - \tan (5 \pi \cos \theta) \tan (5 \pi \sin \theta)}{\tan (5 \pi \cos \theta) + \tan (5 \pi \sin \theta)} \\
&= 0.
\end{align*}Hence, $5 \pi \cos \theta + 5 \pi \sin \theta$ must be an odd multiple of $\frac{\pi}{2}.$  In other words,
\[5 \pi \cos \theta + 5 \pi \sin \theta = (2n + 1) \cdot \frac{\pi}{2}\]for some integer $n.$  Then
\[\cos \theta + \sin \theta = \frac{2n + 1}{10}.\]Using the angle addition formula, we can write
\begin{align*}
\cos \theta + \sin \theta &= \sqrt{2} \left( \frac{1}{\sqrt{2}} \cos \theta + \frac{1}{\sqrt{2}} \sin \theta \right) \\
&= \sqrt{2} \left( \sin \frac{\pi}{4} \cos \theta + \cos \frac{\pi}{4} \sin \theta \right) \\
&= \sqrt{2} \sin \left( \theta + \frac{\pi}{4} \right).
\end{align*}so
\[\sin \left( \theta + \frac{\pi}{4} \right) = \frac{2n + 1}{10 \sqrt{2}}.\]Thus, we need
\[\left| \frac{2n + 1}{10 \sqrt{2}} \right| \le 1.\]The integers $n$ that work are $-7,$ $-6,$ $-5,$ $\dots,$ $6,$ giving us a total of 14 possible values of $n.$  Furthermore, for each such value of $n,$ the equation
\[\sin \left( \theta + \frac{\pi}{4} \right) = \frac{2n + 1}{10 \sqrt{2}}.\]has exactly two solutions in $\theta.$  Therefore, there are a total of $\boxed{28}$ solutions $\theta.$