The school bought several footballs. If these footballs are evenly distributed to 8 classes, there will be 5 left. If these footballs are evenly distributed to 10 classes, there will be 7 left. How many basketballs did the school buy at least?
学校买来若干个足球．如果把这些足球平均分给8个班，余5只．如果把这些足球平均分给10个班，余7只．学校至少买来多少只篮球？
<gadget id="calculator">2 * 2 * 2 * 5</gadget>
<output>40</output>

<gadget id="calculator">40 - 3</gadget>
<output>37</output>

<result>37</result>