We consider a pure exchange economy with finitely many indivisible commodities that are available only in integer quantities. We prove that in such an economy with a sufficiently large number of agents, but finitely many agents, the strong core coincides with the set of cost-minimized Walras allocations. Because of the indivisibility, the preference maximization does not imply the cost minimization. A cost-minimized Walras equilibrium is a state where, under some price vector, all agents satisfy both the preference maximization and the cost minimization.