Clams and oysters extract calcium and carbon from the water to build their shells. However, from the options provided, the closest correct answer is carbon, as it is a component of carbonate ions (CO3^2-) that combine with calcium (from calcium ions, Ca^2+) to form calcium carbonate (CaCO3), the main material of their shells.
However, it's important to note that none of the options specifically mention calcium, which is crucial for shell formation.