Answer in two ways:
Hypothetical method:
Assuming he is all right, he should get a perfect score of 100.
If you are wrong 1, you won't get 5 points, but you will also deduct 1 points.
The actual score will lose 5+ 1=6 points.
And his actual score is 82 points, which is less than the full mark 100-82= 18 points.
18÷6=3 questions.
That is, he just made three mistakes and got 20-3= 17 right.
Equation method: If you answer the X question correctly, you will answer the (20-x) question incorrectly.
5x-(20-x)=82 gives x= 17.