There are 37 students from class 3 and 2 participating in the competition, including 27 students who participated in the mathematics competition and 29 students who participated in the composition competition. How many people participated in both the mathematics competition and the composition competition?
三2班有37名同学参加竞赛，其中参加数学竞赛的有27人，参加作文竞赛的有29人，既参加数学竞赛又参加作文竞赛的有多少人？
<gadget id="calculator">29 - 37</gadget>
<output>-8</output>

<gadget id="calculator">27 + (-8)</gadget>
<output>19</output>

<result>19</result>