Count number of retrieved groups