Calculating totals for HDPS