[jQuery] Overriding block tags on the number of fields in a section

I have a code:

<ul id="list_people">
  <li>
    <h4>A<!-- There should add: 3 --></h4>
    <ul>
        <li>Adamski Piter</li>
        <li>Amart Jan</li>
        <li>Azyl Pawel</li>
    </ul>
    </li>
  <li>
    <h4>B<!-- There should add: 2 --></h4>
    <ul>
       <li>Bamer Anna</li>
       <li>Bit Miron</li>
    </ul>
  </li>
    <li>
    <h4>C<!-- There should add: 1 --></h4>
    <ul>
       <li>Cel Maciej</li>
    </ul>
  </li>
</ul>
<script type="text/javascript">
var number_of_sections=$('#list_people h4').size();

var people_in_the_section=[];  
for(var i=0; i<number_of_sections; i++)
{
    people_in_the_section[i]=$("#list_people li ul lil:eq(" + i + ")").size();
    $("#list_people h4:eq(" + i + ")").append(people_in_the_section[i]);

}
</script>

My question is: what am I doing wrong that it does not show me the correct number of tags h4 searched elements?

Hi there,
I don’t know if this helps, but you can find the number of h4 tags within the “list_people” <ul> like this:

$("#list_people h4").length;