Input
The first line of input contains a single integer n (n<6000). Each of the next n lines contains a five letter word.
Output
Print out the number of connected components of the graph you constructed.
Sample Input
6
aaaaa
aaaab
aaaac
ccccd
cccce
aaabb
Sample Output
2