Compute the height of a radix tree Introduction

A radix tree, also known as compressed trie or compressed prefix tree, is a tree-like data structure for storing a set of strings.
The edges of the tree are labeled by nonempty strings, and each node is either terminal or nonterminal.
The strings that the tree contains are exactly the labels of all paths from the root to a terminal node.
The tree must be in the normal form defined by the following conditions:


All nonterminal non-root nodes have at least two children.
For every node, all outgoing edges have different first characters.


For example, here is the radix tree containing the set ["test", "testing", "tested", "team", "teams", "technical", "sick", "silly"], with (N) representing a nonterminal node and (T) a terminal node:

-(N)-te-(N)-st-(T)-ing-(T)
  |      |      | 
  |      |      +-ed-(T)
  |      |
  |      +-am-(T)-s-(T)
  |      |
  |      +-chnical-(T)
  |
  +-si-(N)-ck-(T)
        |
        +-lly-(T)


In this challenge, your task is to compute the height of the tree, given the strings as input.

Input

Your input is a non-empty list of strings of lowercase ASCII letters.
It will not contain duplicates, but it may be in any order.
It may contain the empty string.
You may take the input in any reasonable format.

Output

Your output shall be the length of the longest root-to-leaf path in the corresponding radix tree, measured in the number of nodes it contains.

In the above example, the correct output is 4, corresponding to the paths

(N)-te-(N)-st-(T)-ing-(T)
(N)-te-(N)-st-(T)-ed-(T)
(N)-te-(N)-am-(T)-s-(T)


which contain 4 nodes.

Further examples

Here are a couple more examples of radix trees:

[""]
-(T)

["","fuller"]
-(T)-fuller-(T)

["","full","fuller"]
-(T)-full-(T)-er-(T)

["full","fuller"]
-(N)-full-(T)-er-(T)

["full","filler"]
-(N)-f-(N)-ull-(T)
        |
        +-iller-(T)


Rules and scoring

You can write a full program or a function.
This is code golf, so the lowest byte count wins.

You can use any built-ins or libraries you want, but remember to include all imports etc. in your byte count.
Third-party libraries &ndash; those not included in the standard install of your language &ndash; are allowed, but must be listed in the header separately, e.g. Python + pytrie0.2, 60 bytes.

Test cases

[""] -&gt; 1
["fuller"] -&gt; 2
["","fuller"] -&gt; 2
["","full","fuller"] -&gt; 3
["full","fuller"] -&gt; 3
["full","filler"] -&gt; 3
["full","filler","filter"] -&gt; 4
["full","filler","fi","filter"] -&gt; 5
["test","testing","tested","team","teams","technical","sick","silly"] -&gt; 4
["a","aaaa","aabbaa","aabbaab","abaaa","aab","aabbb","aabba"] -&gt; 8
["dbdbaca","ab","a","caaabaaa","adbbabdb","dbdbdbaca","dbbadbacaba","db"] -&gt; 4
["db","dbbdbb","dbaa","cabcacaa","","acaabcacab","b","abaaaca","bacaaaaa"] -&gt; 3
["aabaabdbb","bacaabadbbdb","abb","aabaa","ab","bcadbb","adbbcaaadbbb","caaa","bbdbcacadbab","dbbdbdb"] -&gt; 4
["bbcaaabbbabbcadbbacadbbdbdb","b","bbbbaaaaaababa","ca","bb","bdbbacadbbdbbdbbababaacaca","abbaabbabcabaaa","bbbacacacabcacacabaaabb","bbcaaaab","bbbbcaacaadbcaaa","babbabcadbdbacacabbcacab","abcabbbaacadbcadb","bbcabbcadbcacaacaadbadbcaadb","dbbbdbbdbacaabbacabcadbdbacaca","bbaabdbdb","cabcadbbbadbadbbaadbcaca","adbadbadbdbcacadbdbbcaadbcaca","abaabbcab","aaabcaabcaab","bacacabcacaacadbadbb"] -&gt; 6
JavaScript (Firefox 30-57), 137 bytes

f=(a,b=["",...a],s=new Set(b.map(w=&gt;w[0])))=&gt;b.length&gt;1?(s.size&gt;1)+Math.max(...(for(c of s)f(a,[for(w of b)if(w&amp;&amp;w[0]==c)w.slice(1)]))):1


There must be something wrong with my algorithm as I seem to have to special-case an empty string parameter.