Compute branching factor