Sadia had p mangoes in her basket. She bought 9 more mangoes. She had a total of 16 mangoes. Find the value of p.