Add total calculation script