Write a program to Count the number of words in a string.

 

Output: