• + 0 comments

    from collections import defaultdict n=int(input()) d=defaultdict(list) for i in range(n): s=input() d[s].append(i) print(len(d.keys())) print(*list(map(lambda x:len(x),d.values())))