S = eval(input())

N = len(S)

ans = 1 + N*(N-1)//2

ct = [0] * 26

for c in S:

    i = ord(c) - ord('a')

    ct[i] += 1



for a in ct:

    ans -= a*(a-1)//2

print(ans)
from collections import Counter

A = eval(input())

ctr = Counter(A)



ans = 0

for k,v in list(ctr.items()):

    for k2,v2 in list(ctr.items()):

        if k==k2: continue

        ans += v*v2

print((ans//2 + 1))
S = eval(input())
N = len(S)
ans = 1 + N * (N - 1) // 2
ct = [0] * 26
for c in S:
    i = ord(c) - ord("a")
    ct[i] += 1
for a in ct:
    ans -= a * (a - 1) // 2
print(ans)

from collections import Counter

A = eval(input())
ctr = Counter(A)
ans = 0
for k, v in list(ctr.items()):
    for k2, v2 in list(ctr.items()):
        if k == k2:
            continue
        ans += v * v2
print((ans // 2 + 1))

-S = eval(input()) -N = len(S) -ans = 1 + N * (N - 1) // 2 -ct = [0] * 26 -for c in S: -    i = ord(c) - ord("a") -    ct[i] += 1 -for a in ct: -    ans -= a * (a - 1) // 2 -print(ans) +from collections import Counter + +A = eval(input()) +ctr = Counter(A) +ans = 0 +for k, v in list(ctr.items()): +    for k2, v2 in list(ctr.items()): +        if k == k2: +            continue +        ans += v * v2 +print((ans // 2 + 1))