How do I count only certain rows in a repeating group

You can’t access the RG’s innards like that. As covered here: