In the third grade, 58 students participated in the Chinese competition, 62 students participated in the mathematics competition, and 22 students participated in both. How many people in the third grade participated in the Chinese and mathematics competitions?
三年级参加语文竞赛的有58人，参加数学竞赛的有62人，两项都参加的有22人，三年级参加语文和数学竞赛的一共有多少人？
<gadget id="calculator">62 - 22</gadget>
<output>40</output>

<gadget id="calculator">58 + 40</gadget>
<output>98</output>

<result>98</result>