{"raw_statement":[{"iden":"statement","content":"In Aramic language words can only represent objects.\n\nWords in Aramic have special properties:\n\n*   A word is a _root_ if it does not contain the same letter more than once.\n*   A _root_ and all its permutations represent the same object.\n*   The _root_ $x$ of a word $y$ is the word that contains all letters that appear in $y$ in a way that each letter appears once. For example, the _root_ of \"_aaaa_\", \"_aa_\", \"_aaa_\" is \"_a_\", the _root_ of \"_aabb_\", \"_bab_\", \"_baabb_\", \"_ab_\" is \"_ab_\".\n*   Any word in Aramic represents the same object as its _root_.\n\nYou have an ancient script in Aramic. What is the number of **different objects** mentioned in the script?"},{"iden":"input","content":"The first line contains one integer $n$ ($1 \\leq n \\leq 10^3$) — the number of words in the script.\n\nThe second line contains $n$ words $s_1, s_2, \\ldots, s_n$ — the script itself. The length of each string does not exceed $10^3$.\n\nIt is guaranteed that all characters of the strings are small latin letters."},{"iden":"output","content":"Output one integer — the number of different objects mentioned in the given ancient Aramic script."},{"iden":"examples","content":"Input\n\n5\na aa aaa ab abb\n\nOutput\n\n2\n\nInput\n\n3\namer arem mrea\n\nOutput\n\n1"},{"iden":"note","content":"In the first test, there are two objects mentioned. The roots that represent them are \"_a_\",\"_ab_\".\n\nIn the second test, there is only one object, its root is \"_amer_\", the other strings are just permutations of \"_amer_\"."}],"translated_statement":[{"iden":"statement","content":"在阿兰语中，单词只能表示物体。\n\n阿兰语的单词具有特殊性质：\n\n你有一份古老的阿兰语手稿。手稿中提到了多少个*不同的物体*？\n\n第一行包含一个整数 $n$ ($1 lt.eq n lt.eq 10^3$) —— 手稿中的单词数量。\n\n第二行包含 $n$ 个单词 $s_1, s_2, dots.h, s_n$ —— 手稿本身。每个字符串的长度不超过 $10^3$。\n\n保证所有字符串中的字符均为小写拉丁字母。\n\n请输出一个整数 —— 给定的古老阿兰语手稿中提到的不同物体的数量。\n\n在第一个测试用例中，提到了两个物体。表示它们的词根是 \"_a_\"、\"_ab_\"。\n\n在第二个测试用例中，只有一个物体，其词根是 \"_amer_\"，其他字符串只是 \"_amer_\" 的排列。"},{"iden":"input","content":"第一行包含一个整数 $n$ ($1 lt.eq n lt.eq 10^3$) —— 手稿中的单词数量。第二行包含 $n$ 个单词 $s_1, s_2, dots.h, s_n$ —— 手稿本身。每个字符串的长度不超过 $10^3$。保证所有字符串中的字符均为小写拉丁字母。"},{"iden":"output","content":"请输出一个整数 —— 给定的古老阿兰语手稿中提到的不同物体的数量。"},{"iden":"examples","content":"输入5a aa aaa ab abb输出2输入3amer arem mrea输出1"},{"iden":"note","content":"在第一个测试用例中，提到了两个物体。表示它们的词根是 \"_a_\"、\"_ab_\"。在第二个测试用例中，只有一个物体，其词根是 \"_amer_\"，其他字符串只是 \"_amer_\" 的排列。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of words in the script.  \nLet $ S = (s_1, s_2, \\dots, s_n) $ be a sequence of strings, where each $ s_i $ consists of lowercase Latin letters.\n\nFor any string $ s $, define its *root* as the set of distinct characters in $ s $, represented as a sorted string (or equivalently, as a set).  \nLet $ R(s) = \\text{sorted}(\\text{set}(s)) $ denote the root of string $ s $.\n\n**Constraints**  \n1. $ 1 \\le n \\le 10^3 $  \n2. For each $ i \\in \\{1, \\dots, n\\} $, $ 1 \\le |s_i| \\le 10^3 $  \n3. Each character in every $ s_i $ is a lowercase Latin letter.\n\n**Objective**  \nCompute the number of distinct roots among all words in the script:  \n$$\n\\left| \\left\\{ R(s_i) \\mid i \\in \\{1, \\dots, n\\} \\right\\} \\right|\n$$","simple_statement":null,"has_page_source":false}