String diversity is the number of symbols that occur in the string at least once. Diversity of *s* will be denoted by *d*(*s*). For example , *d*("aaa")=1, *d*("abacaba")=3.

Given a string *s*, consisting of lowercase Latin letters. Consider all its substrings. Obviously, any substring diversity is a number from 1 to *d*(*s*). Find statistics about substrings diversity: for each *k* from 1 to *d*(*s*), find how many substrings of *s* has a diversity of exactly *k*.
The input consists of a single line containing *s*. It contains only lowercase Latin letters, the length of *s* is from 1 to 3·10<sup class="upper-index">5</sup>.
str = input()
n = len(str)
divDict = [0] * n
letters = set()
left = 0

for right in range(n):
    while str[right] in letters:
        letters.remove(str[left])
        left += 1
    letters.add(str[right])
    divDict[len(letters) - 1] += (right - left + 1)

print(len(letters))
for i in range(len(letters)):
    print(divDict[i])

