Get number of descendants of a node in a tree

We have a simple tree in which the parents are connected with the children by a <parent_of> edge. Is there a way to find out the number of all descendants of a particular node?

And if that is possible, is it possible to apply a filter to the successors? For example, I only want to count the descendants whose name starts with ‘m’.

Sorry the delay, there is Recurse Query https://docs.dgraph.io/query-language/#recurse-query
you can use filter with regex to do it.