5. Let the complex number $z=\cos \frac{4 \pi}{7}+\mathrm{i} \sin \frac{4 \pi}{7}$. Then the value of $\left|\frac{z}{1+z^{2}}+\frac{z^{2}}{1+z^{4}}+\frac{z^{3}}{1+z^{6}}\right|$
is $\qquad$ (answer with a number).