Count frequency of words.