Finish exercise 5: Count the number of words