
A different way to count the same routes is to sort them by which node they use right before reaching $Q$, either node 4 or node 5, instead of sorting them by the first node they visit after $P$.
Let's summarize:
Adding the two groups gives $5 + 4 = 9$ routes in total, the same answer found by grouping from the P side.