Skip to content
UPEEC

Anagram Groups

Medium#strings#hashing#sorting· solved by 0 · time limit 2.0 s

Group the words so that anagrams are in the same group. How many groups are there?

Input

nn, then nn lowercase words, one per line.

Output

The number of groups.

Constraints

1≤n≤1041 \le n \le 10^4, words up to 20 letters.

Sample 1

Input

6
eat
tea
tan
ate
nat
bat

Output

3

Sign in or join free to run and submit your solution.