#C4269. Count Unique Anagram Groups

    ID: 47788 Type: Default 1000ms 256MiB

Count Unique Anagram Groups

Count Unique Anagram Groups

You are given a list of strings. Two strings are considered anagrams if one can be rearranged to form the other. Your task is to count the number of unique anagram groups present in the list.

The input is provided via Standard Input (stdin). The first line consists of an integer n, denoting the number of strings. Each of the following n lines contains a single string. Note that strings may be empty.

Your program should output a single integer to Standard Output (stdout) representing the number of unique groups of anagrams. An anagram group is formed by all strings that, when their letters are sorted, have the same resulting sequence.

Example:

Input:
3
listen
silent
enlist

Output: 1

</p>

In the above example, all three strings are anagrams of each other, so the output is 1.

inputFormat

The first line contains a single integer n (1 ≤ n ≤ 105), representing the number of strings. The next n lines each contain a string. The strings consist of lowercase letters (a-z) and can be empty.

outputFormat

Output a single integer representing the number of unique anagram groups.

## sample
1
listen
1