Simple program that counts the length of each word in a string