A grocer bought 24Kg of coffee beans at price X. After a while one third of the stock got spoiled so he sold the rest for 200$ per Kilo and made a total profit of twice the cost. What must be price X?