#Lutece2408. C++++

C++++

Migrated from Lutece 2408 C++++

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

whfym 决定制造一种船新的语言,他已经选好了 nn 个由小写字母构成的单词作为语言的备用关键词。为了使这种语言尽量高深,每种小写字母最多在每个单词中出现一次。同时他还想让关键词间不会产生混淆,若一个单词能通过交换其中不相同的两个字母变为另一个单词,则这一对单词间会产生混淆。whfym 想知道他的语言中最多有多少个关键词。

Input

第一行一个正整数 nn (1n1\le n \le10310^3),表示备选单词个数。

接下来 nn 行每行一个字符串 sis_i,表示第 ii 个单词。输入保证不存在相同的两个单词,且每种小写字母最多在每个单词中出现一次。

Output

输出一个正整数表示答案。

Samples

6
awsl
aswl
awls
wals
orz
rzo
4

Resources

cyt