In the chemical reaction given:
\[ \text{CaCO}_3 \rightarrow \text{CO}_2 + \text{CaO} \]
the law of conservation of mass states that mass is neither created nor destroyed in a chemical reaction. This means that the total mass of the reactants must equal the total mass of the products.
If a scientist starts with 30 grams of calcium carbonate (CaCO3), upon heating, the products (CO2 and CaO) will also have a total mass of 30 grams.
Therefore, the correct response is:
30 grams