str_lset = set(input())
ans = 0
for each in str_lset:
    if 0 <=ord(each)<=127:
        ans += 1
print(ans)

先去重,直接改为集合

然后ord直接拿到ascii比较