The school set up two interest groups. 42 people from classes 3 and 3 signed up to participate in the activity. Among them, 27 people participated in the painting and calligraphy group, and 24 people participated in the chess group. How many people participated in both groups?
学校开设两个兴趣小组，三3班42人都报名参加了活动，其中27人参加书画小组，24人参加棋艺小组，两个小组都参加的有多少人
<gadget id="calculator">24 - 42</gadget>
<output>-18</output>

<gadget id="calculator">27 + (-18)</gadget>
<output>9</output>

<result>9</result>