Not sure I follow:
The total number of line items in the cart, or the total Quantity for the cart?
if the total number of line items, add a new column to the cart for example, lets call the column lineCount. In the add to cart buttons set that column to 1.
you can then get the total number of line items using:
<?php echo $cartName->TotalColumn("lineCount"); ?>
where cartName is name of the cart object.
if you want total quantity:
<?php echo $cartName->TotalColumn("Quantity"); ?>