How To Count All The Substrings