${\bf 1\ }$ For the moment a configuration $a=(\alpha_1,\alpha_2,\ldots,,\alpha_5)$ of angles $\alpha_i$ is admissible when
$$0\leq\alpha_1\leq\alpha_2\leq\alpha_3\leq\alpha_4\leq\alpha_5\leq\pi,\qquad
\sum_{i=1}^5\alpha_i=3\pi\ .$$
Let $Q$ be the compact set of admissible configurations $a$, and put
$$\Phi(a):=\sum_{i=1}^5\cos\alpha_i\quad(a\in Q)\ ,\qquad \mu:=\min_{a\in Q}\Phi(a)\ .$$
When $\Phi(a)=\mu$ then $a$ is called an optimal configuration.
${\bf 2\ }$ Let $a\in Q$ be an optimal configuration. Then
$$0\leq\alpha_1\leq\ldots\leq\alpha_r<{\pi\over2}\leq \alpha_{r+1}\leq\ldots\leq\alpha_5\leq\pi$$
for some $r\geq0$. Since the function $\cos$ is properly convex in the interval $\bigl[{\pi\over2},\pi\bigr]$ it follows from Jensen's inequality that $$\alpha_{r+1}=\ldots=\alpha_5=\alpha\tag{1}$$ for a certain $\alpha\in\bigl[{\pi\over2},\pi\bigr]$. We then have
$$3\pi=\alpha_1+\ldots+\alpha_r+(5-r)\alpha<r{\pi\over2}+(5-r)\alpha=(5-r)\left(\alpha-{\pi\over2}\right)+5{\pi\over2}\ ,$$
or
$$(5-r)\left(\alpha-{\pi\over2}\right)>{\pi\over2}\ .$$
It follows that $r\leq3$ (whence $r+2\leq5$) and that $\alpha>{\pi\over2}$.
${\bf 3\ }$ Let $a\in Q$ still be optimal and assume that $0<\alpha_i\leq\alpha_j<\pi$ for two entries $\alpha_i$, $\alpha_j$. Then one would have
$${d\over d\epsilon}\bigl(\cos(\alpha_i+\epsilon)+\cos(\alpha_j-\epsilon)\bigr)\biggr|_{\epsilon=0}=0\ ,$$
or $\sin\alpha_i=\sin\alpha_j\>$. This implies that all $\alpha_i\notin\{0,\pi\}$ have the same sine.
${\bf 4\ }$ We first consider the case ${\pi\over2}<\alpha<\pi$. I claim that $\sin\alpha_r=\sin\alpha$ is impossible. Proof: We then would have $\cos\alpha_r=-\cos\alpha$ and could replace $\alpha_r$, $\alpha_{r+1}$ by $$\alpha_r'=\alpha_{r+1}':={\pi\over2}\quad <\alpha=\alpha_{r+2}$$ and still have $\Phi(a')=\mu$. This would contradict property $(1)$ of optimal configurations.
It follows that $\alpha_1=\ldots=\alpha_r=0$. This leaves us with the following configurations:
$$\eqalign{&r=0:\quad a=({3\pi\over5},{3\pi\over5},{3\pi\over5},{3\pi\over5},{3\pi\over5}), \quad \Phi(a)=5\cos{3\pi\over5}\doteq-1.54508,\cr
&r=1:\quad a=(0,{3\pi\over4},{3\pi\over4},{3\pi\over4},{3\pi\over4}), \quad \Phi(a)=1+4\cos{3\pi\over4}\doteq-1.82843.\cr}$$
It is easily checked that $r=2$ and $r=3$ are impossible in this case.
${\bf 5\ }$ When $\alpha=\pi$ then necessarily $r=2$ or $r=3$. The case $r=2$ enforces the configuration
$$a=(0,0,\pi,\pi,\pi),\quad \Phi(a)=-1\ ,$$
and the case $r=3$ together with $\alpha_r<{\pi\over2}$ enforces the configuration
$$a=({\pi\over3},{\pi\over3},{\pi\over3},\pi,\pi),\quad \Phi(a)=-{1\over2}\ .$$
${\bf 6\ }$ Comparing the obtained data we conclude that
$$\mu=\Phi\bigl(0,{3\pi\over4},{3\pi\over4},{3\pi\over4},{3\pi\over4}\bigr)=1-2\sqrt{2}\doteq-1.82843\ .$$
In the formulation of the problem by the OP angles $\alpha_i\in\{0,\pi\}$ are forbidden. It follows from our analysis that the function $\Phi$ assumes no minimum on $Q_{\rm OP}$. All we can say is that
$$\inf\nolimits_{a\in Q_{\rm OP}}\Phi(a)=1-2\sqrt{2}\ .$$