After learning a lot about space exploration, a little girl named Ana wants to change the subject.

Ana 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's 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:

You are given an array of strings which consist of only small letters of the alphabet. Your task is to find how many palindrome pairs are there in the array. A palindrome pair is a pair of strings such that the following condition holds: at least one permutation of the concatenation of the two strings is a palindrome. In other words, if you have two strings, let's say "aab" and "abcac", and you concatenate them into "aababcac", 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 "aabccbaa"). 

Two pairs are considered different if the strings are located on different indices. The pair of strings with indices $(i,j)$ is considered the same as the pair $(j,i)$.


-----Input-----

The first line contains a positive integer $N$ ($1 \le N \le 100\,000$), representing the length of the input array.

Eacg of the next $N$ lines contains a string (consisting of lowercase English letters from 'a' to 'z') — an element of the input array. 

The total number of characters in the input array will be less than $1\,000\,000$.


-----Output-----

Output one number, representing how many palindrome pairs there are in the array.


-----Examples-----
Input
3
aa
bb
cd

Output
1

Input
6
aab
abcac
dffe
ed
aa
aade

Output
6



-----Note-----

The first example:  aa $+$ bb $\to$ abba. 

The second example:  aab $+$ abcac $=$ aababcac $\to$ aabccbaa aab $+$ aa $=$ aabaa abcac $+$ aa $=$ abcacaa $\to$ aacbcaa dffe $+$ ed $=$ dffeed $\to$ fdeedf dffe $+$ aade $=$ dffeaade $\to$ adfaafde ed $+$ aade $=$ edaade $\to$ aeddea

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = '# -*- coding:utf-8 -*-\n\n"""\n\ncreated by shuangquan.huang at 11/20/18\n\n\n\nAfter learning a lot about space exploration, a little girl named Ana wants to change the subject.\n\nAna is a girl who loves palindromes (string that can be read the same backwards as forward).\nShe has learned how to check for a given string whether it\'s a palindrome or not, but soon she grew tired of this problem,\nso she came up with a more interesting one and she needs your help to solve it:\n\nYou are given an array of strings which consist of only small letters of the alphabet.\nYour task is to find how many palindrome pairs are there in the array.\nA palindrome pair is a pair of strings such that the following condition holds:\nat least one permutation of the concatenation of the two strings is a palindrome.\nIn other words, if you have two strings, let\'s say "aab" and "abcac",\nand you concatenate them into "aababcac", we have to check if there exists a permutation of this new string such that\nit is a palindrome (in this case there exists the permutation "aabccbaa").\n\nTwo pairs are considered different if the strings are located on different indices.\nThe pair of strings with indices (𝑖,𝑗) is considered the same as the pair (𝑗,𝑖).\n\nInput\nThe first line contains a positive integer 𝑁 (1≤𝑁≤100 000), representing the length of the input array.\n\nEacg of the next 𝑁 lines contains a string (consisting of lowercase English letters from \'a\' to \'z\') — an element of the input array.\n\nThe total number of characters in the input array will be less than 1000000.\n\nOutput\nOutput one number, representing how many palindrome pairs there are in the array.\n\n\n\n# a, b can be transform to palindrome only when number of every characters in a+b is even, or only one is odd.\n# only odd+even => odd\n\n\n"""\n\nimport collections\n\nN = int(input())\n\n\ndef hash(s):\n    wc = collections.Counter(s)\n    x = \'\'\n    for i in range(26):\n        w = chr(ord(\'a\') + i)\n        c = wc[w]\n        if c % 2 == 0:\n            x += \'0\'\n        else:\n            x += \'1\'\n    \n    return x\n\n\ndef neighbor(s):\n    for i in range(len(s)):\n        yield s[:i] + (\'1\' if s[i] == \'0\' else \'0\') + s[i + 1:]\n\n\ndef isneighbor(a, b):\n    return sum([0 if a[i] == b[i] else 1 for i in range(len(a))]) == 1\n\nm = collections.defaultdict(list)\nfor i in range(N):\n    s = input()\n    m[hash(s)].append(i)\n\neven = 0\nodd = 0\nfor k, v in list(m.items()):\n    lv = len(v)\n    even += lv * (lv - 1) // 2\n    \n    for b in neighbor(k):\n        if b in m:\n            odd += lv * len(m[b])\n\nprint(even + odd // 2)\n\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13203