• + 0 comments
    from collections import defaultdict
    
    d = defaultdict(int)
    n = int(input())
    
    for _ in range(n):
        d[input()] += 1
    
    print(len(d))
    print(*d.values())