Calculate total working