how to calculate the labor and materials