Get the ticks of lower <hx> first, not of higher

In my opinion the logic was wrong.
Imagine to have a book with 20 h3s. Each of the h32 has 10-20 h4s (all in all for sure more than 50), and some of these h4 also have some h5s.
With the old logic you would see the h5s only since the h4s are too much.
But the h3s are way more important than the h5s, so the counter should start at the beginning.

I am unsure though if the for-loop should start with 1 or if we know somehow already that h3 is the smallest?
Changed it. To change that one line alone is not enough since you will get the next higher number above 50. My understanding is to have 50 as the upper limit, so I had to remember the last result before I cross that limit, see new commit.