Magento count cart items : You Can count carts item from the current quote.
Magento count cart items Syntax
$count = Mage::helper('checkout/cart')->getCart()->getItemsCount();
Which will the total no of items in the cart.
If Want to process all items
$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();