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