from collections import Counter input_str = input() d = Counter() ans = 0 for s in input_str: d[s] += 1 if d[s] == 1: ans += 1 print(ans) 计数器计数,只出现1次总数+1