how to calculate capital operating cost mining