2019 South Central USA Regional Contest

#### Start

2019-11-09 09:00 AKST

## 2019 South Central USA Regional Contest

#### End

2019-11-09 14:00 AKST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -246 days 9:58:45

5:00:00

0:00:00

# Problem CCode Names

You are given $W$, a set of $N$ words that are anagrams of each other. There are no duplicate letters in any word. A set of words $S \subseteq W$ is called “swap-free” if there is no way to turn a word $x \in S$ into another word $y \in S$ by swapping only a single pair of (not necessarily adjacent) letters in $x$. Find the size of the largest swap-free set $S$ chosen from the given set $W$.

## Input

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

## Output

Output the size of the largest swap-free set.

Sample Input 1 Sample Output 1
6
abc
acb
cab
cba
bac
bca

3

Sample Input 2 Sample Output 2
11
alters
artels
estral
laster
ratels
salter
slater
staler
stelar
talers

8

Sample Input 3 Sample Output 3
6
ates
east
eats
etas
sate
teas

4