Python: Count items using itertools