Custom Function to Count the Records in a Related List

Custom Function to Count the Records in a Related List

I am looking for script for a custom function for a Zoho CRM workflow to count the number of records in a related list like is shown in this custom employee count video:

https://www.youtube.com/watch?v=wA8GMVk57Jk

Can you send me one?