It is known that both numbers m and n contain only prime factors 2 and 7, and their greatest common factor is 56. Given that m has 12 factors and n has 10 factors, what is the sum of m and n?
已知m、n两个数都是只含质因数2和7，它们的最大公因数是56．已知m有12个因数，n有10个因数，那么m与n的和是多少．
<gadget id="calculator">2 ** 3</gadget>
<output>8</output>

<gadget id="calculator">7 ** 2</gadget>
<output>49</output>

<gadget id="calculator">8 * 49</gadget>
<output>392</output>

<gadget id="calculator">2 ** 4</gadget>
<output>16</output>

<gadget id="calculator">16 * 7</gadget>
<output>112</output>

<gadget id="calculator">392 + 112</gadget>
<output>504</output>

<result>504</result>