Sensei (Nobita's teacher) gave homework to Nobita. Nobita being weak in studies asks Doremon for help. Doremon takes out one of his Gadget and connects it with your soul as he believes that you are good in programming. Now, your job is to solve the problem for Nobita.
Two strings are called equivalent if one can be obtained from other by removing the character at its first index.
You are given a bucket B1 containing N strings. Find the maximal possible size of set of strings B2 such that each string of B2 is prefix of some string from B1. B2 cannot have equivalent strings. All strings in B1 are different.
Input
First line of Input contains T denoting the number of test cases.
First line of each test case contains a single integer N denoting the size of bucket B1.
Each of the following N lines contains one non-empty string of B1.
Output
For each test case print a single integer denoting the maximal number of strings that B2 can contain. Print the answer for each test case in a separate line.
Constraints
20 points:
N<=100
Length of each string <=100
80 points:
Total length of all strings in Input data does not exceed 10^6.
Problem Setter
Shikhar Kunal