Students in class 51 stand in line to do exercises, with 5 people standing in each row, 3 more people, 7 people standing in each row, or 3 more people, it is known that the number of people in this class does not exceed 40 people. How many people are there in this class?
五1班同学站队做操，每行站5人，多3人，每行站7人，还是多3人，已知这个班的人数不超过40人．这个班有多少人？
<gadget id="calculator">5 * 7</gadget>
<output>35</output>

<gadget id="calculator">35 + 3</gadget>
<output>38</output>

<result>38</result>