5. Given complex numbers $z_{1}, z_{2}, z_{3}$ such that $\frac{z_{1}}{z_{2}}$ is a pure imaginary number, and
$$
\left|z_{1}\right|=\left|z_{2}\right|=1,\left|z_{1}+z_{2}+z_{3}\right|=1 \text {. }
$$

Then the minimum value of $\left|z_{3}\right|$ is $\qquad$ .
5. $\sqrt{2}-1$.

Let $z=z_{1}+z_{2}+z_{3}$. Then $|z|=1$.
$$
\begin{array}{l}
\text { By } \frac{z_{1}}{z_{2}}+\overline{\left(\frac{z_{1}}{z_{2}}\right)}=0 \\
\Rightarrow z_{1} \overline{z_{2}}+z_{2} \overline{z_{1}}=0 .
\end{array}
$$
$$
\begin{array}{l}
\text { Then }\left|z_{1}+z_{2}\right|^{2}=\left(z_{1}+z_{2}\right)\left(\overline{z_{1}+z_{2}}\right) \\
=z_{1} \overline{z_{1}}+z_{2} \overline{z_{2}}+\overline{z_{1}} z_{2}+z_{1} \overline{z_{2}}=2 \\
\Rightarrow\left|z_{1}+z_{2}\right|=\sqrt{2} . \\
\text { Hence }\left|z_{3}\right|=\left|z_{1}+z_{2}-z\right| \\
\quad \geqslant\left|z_{1}+z_{2}\right|-|z|=\sqrt{2}-1 .
\end{array}
$$

When $z_{1}=1, z_{2}=\mathrm{i}, z_{3}=\frac{\sqrt{2}-2}{2}(1+\mathrm{i})$, the minimum value is obtained.