s = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
with open('The Old Man and the Sea.txt', 'r', encoding='utf-8') as data:
txt = data.readlines()
if n > len(txt):
n = len(txt)
mystr = ' '.join(txt[:n])
# print(mystr)
ls = [[x, mystr.lower().count(x)] for x in s]
ls.sort(key=lambda x: (-x[1], x[0]))
# print(ls)
for i in ls:
print('{} 的数量是 {:>3} 个'.format(i[0], i[1]))