You are given a set **S** of **n** strings. Sum of length of all the strings <= 2 * 10^5. Now you have to find the size of the smallest generating set for these **n** strings. The smallest generating set is the minimal set that contains some arbitrary stringsubset of the set **S** such that by concatenation some of its strings multiple times you can generate all the strings in the set **S**. <br>↵
For example let the set **S** contains strings "eapplab" , "applebb" , "b" and "appleee" then the answer is 2 as you can have a set {"apple" , "eb"} and using these strings you can generate all the other 34 strings. Also you can concatenate any string >= 0 times. <br>↵
[Link](https://www.codechef.com/problems/CHN16A) to the problem statement.
For example let the set **S** contains strings "
[Link](https://www.codechef.com/problems/CHN16A) to the problem statement.