e commerce – what quantity to display in the header shopping cart icon

For an e-commerce site, in the header you have the cart icon, with the quantity of items in the cart displayed.

What is the best number to show as the quantity? Should you show the number of unique items, or the number of total items.

e.g. if you have 2 x hats, and 3 x shoes in a cart, should you show the items as 2 (hats + shoes), or 5 (2 hats + 3 shoes)?