Class 1 held a knowledge contest to celebrate New Year's Day. There were 30 multiple-choice questions. It was stipulated that 3 points would be awarded for a correct answer, and 1 point would be deducted for a question that was not answered or answered incorrectly. Xiao Ming scored 78 points. How many questions did he answer correctly?
六1班举行庆元旦知识竞赛，共有30道选择题，规定答对一道题得3分，不答或答错一道题扣1分，小明得了78分，他答对了几道题？
<gadget id="calculator">30 * 3</gadget>
<output>90</output>

<gadget id="calculator">90 - 78</gadget>
<output>12</output>

<gadget id="calculator">3 + 1</gadget>
<output>4</output>

<gadget id="calculator">12 / 4</gadget>
<output>3</output>

<gadget id="calculator">30 - 3</gadget>
<output>27</output>

<result>27</result>