Solving number of words problem from http://code-warrior.herokuapp.com.