number of different substrings with compressed trie