how to calculate total operating cost