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>.
__author__ = 'allen'

st = input()
r = set()
for c in st:
    r.add(c)

uni = list()
for i in range(len(st)):
    for j in range(1, len(st)+1):
        if i < j:
            uni.append(st[i:j])

u = [0 for i in range(len(r))]
for s in uni:
    su = set()
    for c in s:
        su.add(c)
    u[len(su)-1] += 1

print(len(r))
for i in u:
    print(i)