how to calculate grinding cost