Counting words and sorting occurrences.