A = list(eval(input()))

n = len(A)



str_cnt = {}

for a in A:

    if a in str_cnt:

        str_cnt[a] += 1

    else:

        str_cnt[a] = 1

# print(str_cnt)

zen = n * (n - 1) // 2 + 1



for k in str_cnt:

    num = str_cnt[k]

    if num > 1:

        zen -= num * (num - 1) // 2

print(zen)

from collections import Counter

A = list(eval(input()))

n = len(A)

b = Counter(A)

z = n * (n - 1) // 2 + 1



for k in b:

    m = b[k]

    z -= m * (m - 1) // 2

print(z)

A = list(eval(input()))
n = len(A)
str_cnt = {}
for a in A:
    if a in str_cnt:
        str_cnt[a] += 1
    else:
        str_cnt[a] = 1
# print(str_cnt)
zen = n * (n - 1) // 2 + 1
for k in str_cnt:
    num = str_cnt[k]
    if num > 1:
        zen -= num * (num - 1) // 2
print(zen)

from collections import Counter

A = list(eval(input()))
n = len(A)
b = Counter(A)
z = n * (n - 1) // 2 + 1
for k in b:
    m = b[k]
    z -= m * (m - 1) // 2
print(z)

+from collections import Counter + -str_cnt = {} -for a in A: -    if a in str_cnt: -        str_cnt[a] += 1 -    else: -        str_cnt[a] = 1 -# print(str_cnt) -zen = n * (n - 1) // 2 + 1 -for k in str_cnt: -    num = str_cnt[k] -    if num > 1: -        zen -= num * (num - 1) // 2 -print(zen) +b = Counter(A) +z = n * (n - 1) // 2 + 1 +for k in b: +    m = b[k] +    z -= m * (m - 1) // 2 +print(z)