from collections import Counter L=input() a=Counter(L) for k,v in a.items(): print(k,v) 输入 的的ff 输出 的 2 f 2