What is the primary purpose of calculating the Cost of Goods Sold (COGS)?