The school held a math competition with 30 questions in total. According to the rules, 5 points were awarded for a correct answer, 2 points were deducted for a wrong question, and 0 points were awarded for an empty question. As a result, Xiaoming got 112 points. How many questions did he get right?
学校举办数学竞赛，共有30道题，按规则，答对一道题得5分，做错一道题扣2分，空题得0分，结果小明得了112分．他做对了多少题？
<gadget id="calculator">30 - 4 - 2</gadget>
<output>24</output>

<result>24</result>