Count number of nodes in a "non-binary tree" in java
===

I'm writing a program in java to schedule activities from a project, taking into account resource limitations (similar to MS project, but more basic ofcourse). When there are too few resources available, I use a priority rule to arrange the activities in a certain order (such that the most important activities can be scheduled first). 

One of the priority rules I'm scheduling is "**most total successors**", which gives priority to an activity that has the most "unscheduled" followers. I included a picture to give you an idea what I'm talking about (it's not the picture of the project I'm using, because it is too large). For activity A, the total number of successors would be 3 (B, E, C).

I have information about the total number of activities and about the immediate successors of all activities (in binary form, if followers[ 2 ][ 1 ]==1 for example, this means that activity 2 is an immedita follower of activity 1), but my main problem is that I don't know how to get info from the followers' followers and the followers of the followers' followers, and... since I don't know how "deep" my tree is. I already searched for solutions on the internet, but most of them seem to apply for binary trees (like binary search), which is not the case for my network, some activities can have 3 followers or more so it's not a binary tree anymore... (sorry for the misleading picture, didn't find another one). 

Does someone maybe has an idea (or a hint) how I could handle this problem?
Thanks a lot in advance! (And sorry for the long post)   

[Example of a network][1]


  [1]: http://i.stack.imgur.com/vknQv.jpg