The school held a sports meeting. A total of 40 students in the fifth grade participated in various competitions, which was 6 people less than twice the number of participants in the fourth grade. How many people in the fourth grade participated in the competition?
学校举行运动会，五年级共有40人参加各项比赛，比四年级参赛人数的2倍少6人，四年级共有多少人参加比赛？
<gadget id="calculator">6 + 40</gadget>
<output>46</output>

<gadget id="calculator">46 / 2</gadget>
<output>23</output>

<result>23</result>