Finding the length of the last word