How to count repeated elements?

quick update:
I’ve used the technique from this thread in a wip:

Thanks a lot @sebl and @guest!