题解 | #名字的漂亮度#
名字的漂亮度
https://www.nowcoder.com/practice/02cb8d3597cf416d9f6ae1b9ddc4fde3
n = int(input())
for i in range(n):
s = input()
l = []
sum = 0
p = 26
for i in set(s):
l.append(s.count(i))
l.sort(reverse=True)
for i in l:
sum += i*p
p -= 1
print(sum)