The extra branches should not be counted. Try to imagine having to trace the path with your finger. If at any point, you'd have to go backwards with your finger to continue counting, that's where the path would end. Now, if you have a path that creates a loop that re-intersects itself and continues on (think: something that looks like this - ?) , you get to count that in its entirety.