Set Dynamic Panel state based on number of visible elements

I may be going about this incorrectly, so feel free to let me know.

Here’s what I’m trying to accomplish. I need a small icon that displays the current number of selected items. I set up a dynamic panel with ten states. I was going to have the correct state displayed based on number of selected items. Is that the best way to do it? Even as I’m typing I feel that there must be a better way.

solved it. No need for the panels.