5. Out of three hundred eleventh-grade students, excellent and good grades were received by $77 \%$ on the first exam, $71 \%$ on the second exam, and $61 \%$ on the third exam. What is the smallest number of participants who could have received excellent and good grades on all three exams?

Answer: 27.
Let $M_{i}$ be the number of students who received excellent grades only on the $i$-th exam; $M_{ij}$ be the number of students who received excellent grades only on exams $i$ and $j$; $M_{123}$ be the number of students who received excellent grades on all three exams. Then, according to the conditions,

\[
\left\{\begin{array}{l}
M_{1}+M_{12}+M_{13}+M_{123}=231 \\
M_{2}+M_{12}+M_{23}+M_{123}=213 \\
M_{3}+M_{23}+M_{13}+M_{123}=183
\end{array}\right.
\]

Adding all three equations:

\[
M_{1}+M_{2}+M_{3}+2\left(M_{12}+M_{13}+M_{23}\right)+3 M_{123}=627 .
\]

Notice that

\[
M_{1}+M_{2}+M_{3}+M_{12}+M_{13}+M_{23}+M_{123} \leq 300
\]

(on the left side of this inequality, the number of students who received at least one excellent grade is recorded, and on the right side - the total number of students). Subtracting (2) from (1), we get

\[
M_{12}+M_{13}+M_{23}+2 M_{123} \geq 327 \Leftrightarrow\left(M_{12}+M_{13}+M_{23}\right) \geq 327-2 M_{123}
\]

Since $M_{23} \leq 300-231=69, M_{13} \leq 300-213=87, M_{12} \leq 300-183=117$, then $M_{12}+M_{13}+M_{23} \leq 273$. Taking (3) into account, we get that $273 \geq 327-2 M_{123}$, from which $M_{123} \geq 27$.

It is not difficult to verify that the value $M_{123}=27$ can be achieved. For this, take $M_{12}=117$, $M_{13}=87, M_{23}=69, M_{1}=M_{2}=M_{3}=0$.