There are 40 students in class 31, 28 of them participated in the art group, 9 participated in the English group, and 10 did not participate in either group. How many people participated in both groups?
三1班有40名同学，其中28人参加了美术小组，9人参加了英语小组，10人两个小组都没参加．有多少人两个小组都参加了？
<gadget id="calculator">40 - 10</gadget>
<output>30</output>

<gadget id="calculator">9 - 30</gadget>
<output>-21</output>

<gadget id="calculator">28 + (-21)</gadget>
<output>7</output>

<result>7</result>