A company has a beginning inventory of $10,000, purchases of $40,000, and an ending inventory of $15,000. What is the cost of goods sold (COGS)?

A) $35,000
B) $45,000
C) $40,000
D) $30,000