There are 56 students in Class 1 of the fifth grade in a certain school, 38 students participated in the interest group, 32 students participated in the training, and 4 students did not participate in the two groups. How many people participated in both groups?
某校五年级1班有学生56人，参加兴趣小组的有38人，参加培优的有32人，两个小组都未参加的有4人．两小组都参加的有多少人？
<gadget id="calculator">56 - 4</gadget>
<output>52</output>

<gadget id="calculator">32 - 52</gadget>
<output>-20</output>

<gadget id="calculator">38 + (-20)</gadget>
<output>18</output>

<result>18</result>