Counting Plumbing Fixtures for each pipe (Upgrade)

This is great timing, because I think it has very good potential for helping me with the following issue: