Well, for R80 you could use the management API and count the objects in the "members" column of the result of "show groups". Or you can use the script that I have written and linked here. After you have received the csv output just filter for a specific group name in the A column (when opening the csv in Excel) and you can count the hosts in column B. Tough this script does not work for Ipv6 objects - did not have the time and need to update it yet.
More solid solution that also works for IPv6 objects:
=> run "show groups details-level full --format json" via the management api
=> copy the output to your clipboard
=> paste it here or into an offline json viewer regarding any security concerns (I used test data and a cloud test instance for this example)
So for each group you will see the numbers after the "objects" section ~ marked green in the example
For each member of the group you will see numbers in the "members" section of the related group ~ marked red in this example
Keep in mind that there are default output limits of the management api that can be set via the "offset" and "limit" parameter, e.g. the first 50 groups (starting from 0) can be seen via:
mgmt_cli show groups limit 50 offset 0 details-level "full" --format json
The default value here is 50, so if you have more than 50 groups this needs to be changed (or you pull the data interval vise by changing the offset to +50 each time). If you just want the number of hosts for one specific group you can run:
mgmt_cli show group name "HERE_COME_THE_NAME" limit 50 offset 0 details-level "full" --format json
And then you follow the same procedure as above + check the numbers in the members section.
I don't have any clue for R77.30 as I never worked with pre R80 managament, sorry.