• + 0 comments

    Solution

    from collections import Counter
    
    n = int(input())
    
    lista = [input() for x in range(n)]
    
    licznik = Counter(lista)
    
    print(len(licznik))
    print(" ".join(map(str, licznik.values())))