total calculation for hw and sw