Declare a variable with value 0 above the for loop, add totals to this variable's value on each loop, and display the value of the variable as you do with totals after the for loop.
Results that may be inaccessible to you are currently showing.
Hide inaccessible results