Some students in class 31 participated in the "sports meeting". Among them, 22 people participated in rope skipping, 28 people participated in running, and 10 people participated in both items. How many people participated in the competition?
三1班部分同学参加"运动会"，其中参加跳绳的有22人，参加跑步的有28人，两项都参加的有10人，共有多少人参加比赛．
<gadget id="calculator">28 - 10</gadget>
<output>18</output>

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

<result>40</result>