• + 0 comments
    from collections import Counter,OrderedDict
    n=int(input())
    a=[input() for _ in range(n)]
    c=list(OrderedDict.fromkeys(a))
    d=Counter(a)
    b=[d[_] for _ in c]
    print(len(b))
    print(*b,end=" ")