For this case we have to:
x: Let the variable that represents the initial amount of jelly beans in the bag
So:
Maggie ate
of the jelly beans:
![\frac {1} {5} x](https://img.qammunity.org/2021/formulas/mathematics/middle-school/czsknsraml534565aa8zdw2dbi9nx7qqi8.png)
Then he ate 40 jelly beans:
![\frac {1} {5} x-40](https://img.qammunity.org/2021/formulas/mathematics/middle-school/f3yfiyzu41mx91tm7b3s30i2hnmy83rlih.png)
In those two days he ate a total of 107 jelly beans:
![\frac {1} {5} x + 40 = 107](https://img.qammunity.org/2021/formulas/mathematics/middle-school/tzjo38laxnlftdyb16fbobyekhjr2qb9pe.png)
We clear the value of the variable "x":
![\frac {1} {5} x = 107-40\\\frac {1} {5} x = 67\\x = 67 * 5\\x = 335](https://img.qammunity.org/2021/formulas/mathematics/middle-school/xqiifwz7aed4pvn0xme14zjt907pf2nssh.png)
Answer:
The initial quantity of jelly beans was 335