• + 0 comments

    from collections import Counter

    n = int(input())

    words = [input() for _ in range(n)]

    dict_words = Counter(words)

    print(len(dict_words))

    for s, count in dict_words.items():

    print(count, end=' ')