N = int(input()) words = dict() for _ in range(N): word = input() len_word=len(word)# 가중치를 자리수로 두기 위한 값 for char in word:# ex) 'ABC' = 'A'=100, 'B'= 10 'C' =1 if not char in words: words[char] = 0 words[char] += 10**(len_word - 1) len_word -= 1 words=sorted(words.items(),key=lambda x: x[1], reverse=True)# 가중치를 값으로 정렬, 내림차순 result = 0 for i in range(len(words)):# 가중치가 가장 큰 값부터 차례대로 곱해서 더함 result ..