Students from two classes in the fifth grade are doing radio exercises together, and the number of people standing in each row is required to be equal. As a result, there were 2 people standing in 3 rows, 5 rows, and 7 rows. How many students are there in these two classes?
五年级两个班的同学一起做广播操，要求每排所站人数相等．结果站成3排、5排、7排均余2人．这两个班共有学生多少人？
<gadget id="calculator">3 * 5 * 7</gadget>
<output>105</output>

<gadget id="calculator">105 + 2</gadget>
<output>107</output>

<result>107</result>