Problem: There is a given string S consisting of N symbols. Your task is to find the number of ordered pairs of integers i and j such that

1. 1 ≤ i, j ≤ N

2. S[i] = S[j], that is the i-th symbol of string S is equal to the j-th.

Input

The single input line contains S, consisting of lowercase Latin letters and digits. It is guaranteed that string S in not empty and its length does not exceed 105.

Output

Print a single number which represents the number of pairs i and j with the needed property. Pairs (x, y) and (y, x) should be considered different, i.e. the ordered pairs count.

Examples

Input

great10


Output

7


Input

aaaaaaaaaa


Output

100

Solution (in PYTHON3):

Solution:
a = str(input())
aq = 0
aw = 0
ae = 0
ar = 0
at = 0
ay = 0
au = 0
ai = 0
ao = 0
ap = 0
aa = 0
ass = 0
ad = 0
af = 0
ag = 0
ah = 0
aj = 0
ak = 0
al = 0
az = 0
ax = 0
ac = 0
av = 0
ab = 0
an = 0
am = 0
a1 = 0
a2 = 0
a3 = 0
a4 = 0
a5 = 0
a6 = 0
a7 = 0
a8 = 0
a9 = 0
a0 = 0

for i in range(len(a)):
    if a[i] == "q":
        aq += 1
    if a[i] == "w":
        aw += 1
    if a[i] == "e":
        ae += 1
    if a[i] == "r":
        ar += 1
    if a[i] == "t":
        at += 1
    if a[i] == "y":
        ay += 1
    if a[i] == "u":
        au += 1
    if a[i] == "i":
        ai += 1
    if a[i] == "o":
        ao += 1
    if a[i] == "p":
        ap += 1
    if a[i] == "a":
        aa += 1
    if a[i] == "s":
        ass += 1
    if a[i] == "d":
        ad += 1
    if a[i] == "f":
        af += 1
    if a[i] == "g":
        ag += 1
    if a[i] == "h":
        ah += 1
    if a[i] == "j":
        aj += 1
    if a[i] == "k":
        ak += 1
    if a[i] == "l":
        al += 1
    if a[i] == "z":
        az += 1
    if a[i] == "x":
        ax += 1
    if a[i] == "c":
        ac += 1
    if a[i] == "v":
        av += 1
    if a[i] == "b":
        ab += 1
    if a[i] == "n":
        an += 1
    if a[i] == "m":
        am += 1
    if a[i] == "1":
        a1 += 1
    if a[i] == "2":
        a2 += 1
    if a[i] == "3":
        a3 += 1
    if a[i] == "4":
        a4 += 1
    if a[i] == "5":
        a5 += 1
    if a[i] == "6":
        a6 += 1
    if a[i] == "7":
        a7 += 1
    if a[i] == "8":
        a8 += 1
    if a[i] == "9":
        a9 += 1
    if a[i] == "0":
        a0 += 1
b = int(aq**2) + int(aw**2) + int(ae**2) + int(ar**2) + int(at**2) + int(ay**2)
b = b + int(ap**2) + int(aa**2) + int(ass**2) + int(ad**2) + int(af**2) + int(ag**2)
b = b + int(al**2) + int(az**2) + int(ak**2) + int(ao**2) + int(ax**2) + int(ac**2)
b = b + int(an**2) + int(am**2) + int(a1**2) + int(a2**2) + int(a3**2) + int(a4**2)
b = b + int(a7**2) + int(a8**2) + int(a9**2) + int(a0**2) + int(au**2) + int(ai**2)
b = b + int(ah**2) + int(aj**2) + int(av**2) + int(ab**2) + int(a5**2) + int(a6**2)
print(b)