The teacher divided the students into four groups. One group had 5 students, another 8 students, and the third 7 students. If there were 24 total students, how many students were in the fourth group?
There are 5+8+7=
<gadget id="calculator">5+8+7</gadget>
<output>20</output>
20 students in the first three groups.
There are 24-20=
<gadget id="calculator">24-20</gadget>
<output>4</output>
4 students in the fourth group.

<result>4</result>