Calculation of total funds