Xingfu Primary School had 86 graduates during the summer vacation, and 148 new students were recruited at the beginning of the semester. At the same time, 7 students were transferred in and 3 were transferred out. At this time, the school had a total of 654 students. How many students were there in Xingfu Primary School before the summer vacation?
幸福小学暑假毕业学生86人，开学招进新生148人，同时又转入学生7人，转出3人，这时全校共有学生654人，问暑假前幸福小学有多少学生？
<gadget id="calculator">3 - 7 - 148</gadget>
<output>-152</output>

<gadget id="calculator">654 + (-152) + 86</gadget>
<output>588</output>

<result>588</result>