Solution for task #2 words-count.