import os,re S=re.sub('[^\sa-z]','',os.read(0,9e3).lower()).split() for c in sorted(set(S)):print S.count(c),c