In the chemical reaction given:
\[ \text{CaCO}_3 \rightarrow \text{CO}_2 + \text{CaO} \]
the law of conservation of mass states that the total mass of the reactants must equal the total mass of the products.
Since the scientist starts with 30 grams of calcium carbonate (CaCO3) and heats it to form carbon dioxide (CO2) and calcium oxide (CaO), the total mass of the products will also be 30 grams.
Thus, the total mass of the products is 30 grams.