• + 0 comments
    from collections import Counter
    
    if __name__ == "__main__":
        n = int(input())
        words = Counter(input() for i in range(n))
        print(len(set(words)))
        [print(count,end=' ') for word,count in words.items()]