• + 0 comments
    from collections import OrderedDict
    
    input_dict = OrderedDict()
    
    for _ in range(int(input())):
        word = input()
        try:
            input_dict[word] += 1
        except KeyError:
            input_dict[word] = 1
    
    print(len(input_dict))
    for val in input_dict.values():
        print(val, end = " ")