There are 16 people in the Chinese interest group and 18 people in the mathematics interest group in class 31, 6 of them participated in both groups, and none of the groups did not participate. How many people participated in these two interest groups?
三1班参加语文兴趣小组的有16人，参加数学兴趣小组的有18人，其中有6人两个小组都参加了，没有一个小组都不参加的．参加这两个兴趣小组的一共有多少人？
<gadget id="calculator">18 - 6</gadget>
<output>12</output>

<gadget id="calculator">16 + 12</gadget>
<output>28</output>

<result>28</result>