{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eAfter learning a lot about space exploration, a little girl named Ana wants to change the subject.\u003c/p\u003e\u003cp\u003eAna is a girl who loves palindromes (string that can be read the same backwards as forward). She has learned how to check for a given string whether it\u0027s a palindrome or not, but soon she grew tired of this problem, so she came up with a more interesting one and she needs your help to solve it:\u003c/p\u003e\u003cp\u003eYou are given an array of strings which consist of only small letters of the alphabet. Your task is to find \u003cspan class\u003d\"tex-font-style-bf\"\u003ehow many\u003c/span\u003e palindrome pairs are there in the array. A palindrome pair is a pair of strings such that the following condition holds: \u003cspan class\u003d\"tex-font-style-bf\"\u003eat least one\u003c/span\u003e permutation of the concatenation of the two strings is a palindrome. In other words, if you have two strings, let\u0027s say \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaab\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eabcac\u003c/span\u003e\", and you concatenate them into \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaababcac\u003c/span\u003e\", we have to check if there exists a permutation of this new string such that it is a palindrome (in this case there exists the permutation \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaabccbaa\u003c/span\u003e\"). \u003c/p\u003e\u003cp\u003eTwo pairs are considered different if the strings are located on \u003cspan class\u003d\"tex-font-style-bf\"\u003edifferent indices\u003c/span\u003e. The pair of strings with indices $$$(i,j)$$$ is considered \u003cspan class\u003d\"tex-font-style-bf\"\u003ethe same\u003c/span\u003e as the pair $$$(j,i)$$$.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a positive integer $$$N$$$ ($$$1 \\le N \\le 100\\,000$$$), representing the length of the input array.\u003c/p\u003e\u003cp\u003eEacg of the next $$$N$$$ lines contains a string (consisting of lowercase English letters from \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027 to \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ez\u003c/span\u003e\u0027)\u0026nbsp;— an element of the input array. \u003c/p\u003e\u003cp\u003eThe total number of characters in the input array will be less than $$$1\\,000\\,000$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput one number, representing \u003cspan class\u003d\"tex-font-style-bf\"\u003ehow many palindrome pairs\u003c/span\u003e there are in the array.\u003c/p\u003e"}},{"title":"Examples","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\naa\nbb\ncd\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"}},{"title":"","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\u003e6\naab\nabcac\ndffe\ned\naa\naade\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eThe first example:\u003c/p\u003e\u003col\u003e \u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eaa\u003c/span\u003e $$$+$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003ebb\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eabba\u003c/span\u003e. \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eThe second example:\u003c/p\u003e\u003col\u003e \u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eaab\u003c/span\u003e $$$+$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eabcac\u003c/span\u003e $$$\u003d$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaababcac\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaabccbaa\u003c/span\u003e\u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eaab\u003c/span\u003e $$$+$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaa\u003c/span\u003e $$$\u003d$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaabaa\u003c/span\u003e\u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eabcac\u003c/span\u003e $$$+$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaa\u003c/span\u003e $$$\u003d$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eabcacaa\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaacbcaa\u003c/span\u003e\u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003edffe\u003c/span\u003e $$$+$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eed\u003c/span\u003e $$$\u003d$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003edffeed\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003efdeedf\u003c/span\u003e\u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003edffe\u003c/span\u003e $$$+$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaade\u003c/span\u003e $$$\u003d$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003edffeaade\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eadfaafde\u003c/span\u003e\u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eed\u003c/span\u003e $$$+$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaade\u003c/span\u003e $$$\u003d$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eedaade\u003c/span\u003e $$$\\to$$$ \u003cspan class\u003d\"tex-font-style-tt\"\u003eaeddea\u003c/span\u003e \u003c/li\u003e\u003c/ol\u003e"}}]}