#P1808. 单词分类
单词分类
Description
Oliver decides to memorize English vocabulary, but he soon finds it hard to remember disordered words directly, so he decides to classify them.
Two words belong to the same class if and only if the counts of each letter in the two words are equal.
For example, and can be grouped into the same class, whereas is not in the same class.
Now Oliver has words. All words consist of uppercase letters, and each word has a length of at most . You need to tell Oliver how many classes these words are divided into.
Input Format
The first line contains the number of words . Each of the next lines contains one word.
Output Format
Output a single integer, which is the number of classes into which these words are divided.
3
AABAC
CBAAA
AAABB
2
Hint
- For of the testdata, .
- For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号