Count the number of paths leading to the true terminal.
Counts the number of paths from the root node r leading to the terminal true node.