count values in list function