There are 40 students in a class. In the autumn sports meeting organized by the school, each student participated in at least one activity. (3/5) of the class participated in the tug-of-war competition, and (1/2) participated in the relay race. How many people participated in both activities?
某班有学生40人，在学校组织的秋季运动会上，每人至少参加一项活动，全班有(3/5)的人参加了拔河比赛，(1/2)的人参加接力赛跑，这两项活动都参加的有多少人？
<gadget id="calculator">3 / 5</gadget>
<output>3/5 = around 0.6</output>

<gadget id="calculator">40 * (3/5)</gadget>
<output>24</output>

<gadget id="calculator">1 / 2</gadget>
<output>1/2 = around 0.5</output>

<gadget id="calculator">40 * (1/2)</gadget>
<output>20</output>

<gadget id="calculator">24 + 20</gadget>
<output>44</output>

<gadget id="calculator">44 - 40</gadget>
<output>4</output>

<result>4</result>