The simple Cost of Goods Sold equation is
beginning inventory plus purchases minus ending inventory.
You should
enter all three at your actual out of pocket cost.
Your ending inventory is simply the inventory you have left (if any) on December 31, 2017 entered at your actual out of pocket cost.