Anagram Analyser


Submit solution

Points: 1
Time limit: 0.5s
Memory limit: 64M

Author:
Problem type
Allowed languages
C++, Java, Python

In the local newspaper, there is a section on unscrambling anagrams. You want to always solve it most efficiently, so you try to make a program to do it for you. The newspaper presents a whole bunch of words, and two words are anagrams if they contain the same letters in the same amounts, but perhaps different orders. You need to find out how many different groups of anagrams there are.

Input

The first line contains an integer n\ (1 \leq n \leq 10^4), which represents the number of strings there are. The next n lines each contain a string, with each string only containing lowercase alphabetical characters and being between 1 and 50 characters long.

Output

Output the number of distinct anagram groups as an integer.

Example

Input 1
6
slow
rat
lows
tar
art
this
Output 1
3

The tree anagram groups are (slow, lows), (rat, tar, art), and (this).


Comments

There are no comments at the moment.