How to sum all the counts in a repeating group

I found a solution to my question in the topic How to count list items (list field) nested in a Repeating Group