input = "aA11"
input = input.lower()
list = [0] * 36
for i in input:
    if i.isdigit():
        list[int(i)+26]+=1
    else:
        list[ord(i)-97]+=1
i=0
counter = 0
while i < len(input):
    if input[i].isdigit():
        counter += list[int(input[i])+26]-1
        i += list[int(input[i])+26]
    else:
        counter += list[ord(input[i])-97]-1
        i += list[ord(input[i])-97]
print counter
