Task
RANDy is now very interested in winning the grand prize at the new lotteries opened in his country. Because he has relations everywhere, he got a list of the winning numbers from all the lotteries available. The winning numbers are expressed in base 12 (the numbers can begin with digit ).
However, the lotteries could not agree on which letters (upper case English alphabet letters) should be used for and , so each made its own choice. Even though he has such a great advantage, RANDy still doesn't know the rules to win the lottery. He thinks that in order to win the prize from a lottery he needs to guess only one digit from the winning number.
He doesn't know how to write, so help him learn the minimum number of digits in order to win(in his conception) at each lottery.
Input
The first line of the input contains a single number, (), representing the number of lotteries. Each of the next lines contains a number written in base 12, representing the winning numbers.
The sum of lengths of all the numbers is at most .
For test worth points, all the numbers will be written in base .
For test worth more points, all numbers will be written in base , but only with digits and .
For test worth more points, .
Output
The only line of the output contains a single integer, , representing the minimum number of digits RANDy has to learn how to write in order for him to believe he can win every lottery.
Example 1
stdin
4
AABAA
B112
DAA
1777768CD
stdout
2
Explanation
RANDy can learn the folowing two digits: and . He can write for lotteries and and for lotteries and . Thus he thinks that he wins at all of them.