def solution(topping):
answer = 0
tall = {}
for i in (topping):
if i in tall:
tall[i]+=1
else:
tall[i] = 1
me = {} ; me_eat = 0; i = 0 ; sis = len(tall)
while me_eat <= sis:
tall[topping[i]] -= 1
if tall[topping[i]] == 0:
sis -= 1
if topping[i] not in me:
me[topping[i]] = 1
me_eat += 1
if me_eat == sis:
answer += 1
if me_eat > sis:
break
i += 1
return answer