Count occurrences of element in list