In a class, 39 students play basketball, 37 students run, and 25 students play both basketball and running. What is the total number of students in the class who participate in the two sports activities of basketball and running?
某班同学中有39人打篮球，37人跑步，25人既打篮球又跑步，问全班参加篮球、跑步这两项体育活动的总人数是多少？
<gadget id="calculator">37 - 25</gadget>
<output>12</output>

<gadget id="calculator">39 + 12</gadget>
<output>51</output>

<result>51</result>