Using just CSS, that is a bit tricky. Are you looking for a pure CSS-only solution, or would you be ok with a little bit of JavaScript thrown in there?
Notice that I added a variable called --count to represent 0, 1, 2, …, 19. On each div, you can programmatically set the --count variable. This tutorial covers how to do that: https://www.kirupa.com/html5/css_variables_js_win.htm
By setting the count value on each div element, that will carry over into the appropriate value you will need. Does this make sense? I am kinda rushing the explanation while I am wrapping something else up
I was hoping that attr() would work in this context too so count could be set in the html and not through JS, but it looks like its not that well supported yet.
I wonder if this person will ever be back? I find it rather amazing on how many forums this question was actually asked. Interestingly here at Kirupa it seemed to yeild the most discussion, so nice job peeps.