Problem 2. A confectioner received an order to make a certain number of sweets over three days. On the first day, she made $\frac{2}{5}$ of the ordered sweets, on the second day, she made $\frac{5}{9}$ of the remaining sweets, and on the third day, she made the remaining 40 sweets from the order. How many sweets were ordered by the confectioner?
Solution. Let $x$ denote the number of sweets ordered. Then on the first day, $\frac{2}{5} x$ of the sweets were made, on the second day, $\frac{5}{9}\left(x-\frac{2}{5} x\right)$ were made, and on the third day, 40 sweets were made. Therefore,

$$
\frac{2}{5} x+\frac{5}{9}\left(x-\frac{2}{5} x\right)+40=x
$$

By solving this equation, it is found that the number of sweets ordered is $x=150$.