In the school sports meeting, 18 people from class 31 participated in rope skipping, 12 people participated in shuttlecock kicking, and 8 people participated in both of them. How many people participated in these two competitions?
校运会上，三1班参加跳绳的有18人，参加踢毽子的有12人，其中两项都参加的有8人，参加这两项比赛的一共有多少人．
<gadget id="calculator">12 - 8</gadget>
<output>4</output>

<gadget id="calculator">18 + 4</gadget>
<output>22</output>

<result>22</result>