• + 0 comments
    from collections import OrderedDict
    
    if __name__ == '__main__':
        ord_dict = OrderedDict()
        n = int(input())
        #inp = list()
        for i in range(n):
            inp = input()
            if inp in ord_dict:
                ord_dict.update({inp:ord_dict.get(inp)+1})
            else:
                ord_dict.update({inp:1})
        print(len(ord_dict))
        print(*ord_dict.values())