5. If the distances from the center of the ellipse to the focus, the endpoint of the major axis, the endpoint of the minor axis, and the directrix are all positive integers, then the minimum value of the sum of these four distances is $\qquad$ .


5.61.

Let the equation of the ellipse be $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b>0)$, the distances from the center $O$ of the ellipse to the endpoints of the major axis, the endpoints of the minor axis, the foci, and the directrices are $a$, $b$, $c$, $d$ respectively, and satisfy
$$
c^{2}=a^{2}-b^{2}, d=\frac{a^{2}}{c} \text {. }
$$

Since $a$, $b$, $c$ form a Pythagorean triple, the Pythagorean triples satisfying $a \leqslant 20$ are
$$
\begin{aligned}
\{a, b, c\}= & \{3,4,5\},\{6,8,10\},\{9,12,15\}, \\
& \{12,16,20\},\{5,12,13\},\{8,15,17\},
\end{aligned}
$$

Among them, only $\frac{15^{2}}{9}=25$ and $\frac{20^{2}}{16}=25$.
Upon verification, when $(a, b, c, d)=(15,12,9,25)$, the value of $a+b+c+d$ is the smallest.
At this time, $a+b+c+d=61$.