Holly earned $ 390 in the school bake sale. She sold a total of 40 pastries between cakes and dozens of donuts. One cake was sold for $ 15 and one dozen of donuts was worth $ 8. Let c represent the number of cakes, and let d represent the number of dozens of donuts.