For each vertex, track the maximum consecutive cats seen on the path from root to that vertex. If you see a cat, increment the count. If you do not, reset it to zero.
Before recursing into a child, check if the consecutive cat count exceeds . If yes, do not explore that subtree. If no, continue.
At leaf nodes, check if you reached them without violating the cat limit. If yes, increment the restaurant counter.