{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cp\u003eWe will call a string obtained by arranging the characters contained in a string \u003cvar\u003e\\(a\\)\u003c/var\u003e in some order, an \u003cem\u003eanagram\u003c/em\u003e of \u003cvar\u003e\\(a\\)\u003c/var\u003e.\u003c/p\u003e\n \u003cp\u003eFor example, \u003ccode\u003eheart\u003c/code\u003e is an anagram of \u003ccode\u003eearth\u003c/code\u003e. As seen here, when the same character occurs multiple times, that character must be used that number of times.\u003c/p\u003e\n \u003cp\u003eGiven are \u003cvar\u003e\\(N\\)\u003c/var\u003e strings \u003cvar\u003e\\(s_1, s_2, \\ldots, s_N\\)\u003c/var\u003e. Each of these strings has a length of \u003cvar\u003e\\(10\\)\u003c/var\u003e and consists of lowercase English characters, and all of these strings are distinct. Find the number of pairs of integers \u003cvar\u003e\\(i, j\\)\u003c/var\u003e \u003cvar\u003e\\((1 \\leq i \u0026lt; j \\leq N)\\)\u003c/var\u003e such that \u003cvar\u003e\\(s_i\\)\u003c/var\u003e is an anagram of \u003cvar\u003e\\(s_j\\)\u003c/var\u003e.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Constraints","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cul\u003e\n \u003cli\u003e\u003cvar\u003e\\(2 \\leq N \\leq 10^5\\)\u003c/var\u003e\u003c/li\u003e\n \u003cli\u003e\u003cvar\u003e\\(s_i\\)\u003c/var\u003e is a string of length \u003cvar\u003e\\(10\\)\u003c/var\u003e.\u003c/li\u003e\n \u003cli\u003eEach character in \u003cvar\u003e\\(s_i\\)\u003c/var\u003e is a lowercase English letter.\u003c/li\u003e\n \u003cli\u003e\u003cvar\u003e\\(s_1, s_2, \\ldots, s_N\\)\u003c/var\u003e are all distinct.\u003c/li\u003e\n \u003c/ul\u003e\n\u003c/section\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\n \u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e\n\u003cvar\u003e\\(s_1\\)\u003c/var\u003e\n\u003cvar\u003e\\(s_2\\)\u003c/var\u003e\n\u003cvar\u003e\\(:\\)\u003c/var\u003e\n\u003cvar\u003e\\(s_N\\)\u003c/var\u003e\n\u003c/pre\u003e\n\u003c/section\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cp\u003ePrint the number of pairs of integers \u003cvar\u003e\\(i, j\\)\u003c/var\u003e \u003cvar\u003e\\((1 \\leq i \u0026lt; j \\leq N)\\)\u003c/var\u003e such that \u003cvar\u003e\\(s_i\\)\u003c/var\u003e is an anagram of \u003cvar\u003e\\(s_j\\)\u003c/var\u003e.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\nacornistnt\npeanutbomb\nconstraint\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n \u003cp\u003e\u003cvar\u003e\\(s_1 \u003d\\)\u003c/var\u003e \u003ccode\u003eacornistnt\u003c/code\u003e is an anagram of \u003cvar\u003e\\(s_3 \u003d\\)\u003c/var\u003e \u003ccode\u003econstraint\u003c/code\u003e. There are no other pairs \u003cvar\u003e\\(i, j\\)\u003c/var\u003e such that \u003cvar\u003e\\(s_i\\)\u003c/var\u003e is an anagram of \u003cvar\u003e\\(s_j\\)\u003c/var\u003e, so the answer is \u003cvar\u003e\\(1\\)\u003c/var\u003e.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\noneplustwo\nninemodsix\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n \u003cp\u003eIf there is no pair \u003cvar\u003e\\(i, j\\)\u003c/var\u003e such that \u003cvar\u003e\\(s_i\\)\u003c/var\u003e is an anagram of \u003cvar\u003e\\(s_j\\)\u003c/var\u003e, print \u003cvar\u003e\\(0\\)\u003c/var\u003e.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n \u003cp\u003eNote that the answer may not fit into a \u003cvar\u003e\\(32\\)\u003c/var\u003e-bit integer type, though we cannot put such a case here.\u003c/p\u003e\n\u003c/section\u003e"}}]}