Teacher Wang asked two questions. Among the 42 students in the class, 24 people answered question A correctly, and 35 people answered question B correctly. Everyone answered at least one of the questions correctly. How many people answered both questions correctly?
王老师出了两道题，全班42人中答对A题的有24人，答对B题的有35人．每人至少答对了其中的一道题．两道题都答对的有多少人？
<gadget id="calculator">35 - 42</gadget>
<output>-7</output>

<gadget id="calculator">24 + (-7)</gadget>
<output>17</output>

<result>17</result>