Completed the program to find the number of words in a given sentence