python count items in list matching criteria