• + 0 comments
    from collections import Counter
    
    instances = int(input())
    words = []
    
    for i in range(instances):
        words.append(input())
        
    ocurrencies = Counter(words)
    
    print(len(ocurrencies))
    print(" ".join(map(str, ocurrencies.values())))