There are 35 students in class 31, 24 people participate in the basketball interest class, and 18 people participate in the calligraphy interest class. Everyone participates in at least one interest class. How many students participate in both interest classes?
三1班有同学35人，有24人参加篮球兴趣班，有18人参加书法兴趣班，每个人至少参加一个兴趣班，有几名同学两个兴趣班都参加了？
<gadget id="calculator">24 + 18</gadget>
<output>42</output>

<gadget id="calculator">42 - 35</gadget>
<output>7</output>

<result>7</result>