Given strings . Now define as the maximum that satisfy , and if such doesn't exist, . The Problem is to calculate:
输入描述:
The first line contains one integer , denoting the number of given strings. The following lines each contains a string . It's guaranteed that and all strings only contain lowercase letters.
输出描述:
Only one line containing one integer, denoting the answer.