Use the special property `$length` while iterating to get the total amount of items.