Is it going to run on client side?
If so, you can use jQuery to do this very easily.
will give you the count of divs.
To see it in action right here, you can:
1. Pres F12 (get the web browser console open in most browsers)
2. copy the line of code above.
3. paste into the browser console
4. press <enter>
I get 195 for this (CP) page.
Here's a snapshot of what I see in the console output:
If you don't want to use jQuery or it's not available you can use pure JS code:
Again, you can test that here in the console window of your browser.