As ground- or rainwaters flow over and percolate through soil and underground rock formations containing calcitic limestone (CaCO3) or dolomitic limestone [CaMg(CO3)2], the acidity produced by CO2 will dissolve limestone and form calcium and magnesium bicarbonate salts: