Python Count Number Of Substrings In String