5. (3 points) 50 students answered questions $A$ and $B$. Among them, 12 did not answer $A$ correctly, and 30 answered $A$ correctly but did not answer $B$ correctly. Therefore, the number of students who answered both $A$ and $B$ correctly is $\qquad$ people.
【Answer】Solution: $50-12-30=38-30=8$ (people);
Answer: The number of people who answered both questions $A$ and $B$ correctly is 8.
Therefore, the answer is: 8.