• + 0 comments
    from collections import OrderedDict
    d = OrderedDict()
    
    for _ in range(int(input())):
        word = ''.join(input().split())
        d[word] = d.get(word, 0)+1
    print(len(d.keys()))
    print(*d.values())