5. Given complex numbers $z_{1}, z_{2}, z_{3}$ such that $\frac{z_{1}}{z_{2}}$ is a pure imaginary number, $\left|z_{1}\right|=\left|z_{2}\right|=1,\left|z_{1}+z_{2}+z_{3}\right|=1$, then the minimum value of $\left|z_{3}\right|$ is
$\qquad$
Given $\frac{z_{1}}{z_{2}}=a \mathrm{i}(a \in \mathbf{R})$, by $\left|\frac{z_{1}}{z_{2}}\right|=1 \Rightarrow a= \pm 1$, then $z_{1}+z_{2}=(1 \pm \mathrm{i}) z_{2}$.
Thus $1=\left|z_{1}+z_{2}+z_{3}\right| \geqslant\left|z_{1}+z_{2}\right|-\left|z_{3}\right| \Rightarrow\left|z_{3}\right| \geqslant\left|z_{1}+z_{2}\right|-1=\sqrt{2}-1$, equality holds when $z_{1}+z_{2}$ and $z_{3}$ correspond to collinear vectors in the complex plane.