count the number of words