Code Names

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

You are given WW, a set of NN words that are anagrams of each other. There are no duplicate letters in any word. A set of words SWS \subseteq W is called "swap-free" if there is no way to turn a word xSx \in S into another word ySy \in S by swapping only a single pair of (not necessarily adjacent) letters in xx. Find the size of the largest swap-free set SS chosen from the given set WW.

입력

The first line of input contains an integer NN (1N5001 \le N \le 500). Following that are NN lines each with a single word. Every word contains only lowercase English letters and no duplicate letters. All NN words are unique, have at least one letter, and every word is an anagram of every other word.

출력

Output the size of the largest swap-free set.