One molecule of magnesium phosphate, Mg₃(PO₄)₂, contains 2 phosphorus atoms, because P is contained between the brackets followed by a subscripted 2. If in one molecule of magnesium phosphate there are two phosphorus atoms, then in three molecules there are 3 * 2=6 phosphorus atoms.
Bacterial plasmids carry a genome against a specific antibiotic. The process whereby bacterial cells take up the plasmid with the resistance gene is called cloning.