• + 1 comment
    #Most reduced code I hope, comment here to get my reponse within 5 days from this post
    
    from collections import Counter 
    words=[input() for x in range(int(input()))]
    print(len(Counter(words).keys()))
    print(*Counter(words).values(),end=" ")