• + 0 comments
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    # Read all input at once
    
    k = input()
    dic = {}
    key_count = 0
    s=""
    
    for _ in range(int(k)): 
        stri = input()
        if stri not in dic : 
            dic[stri] = 1 
        else: 
            dic[stri]+=1
    print(len(dic))
    for i in dic.values():
        s+=str(i)+" "
    print(s)
    #for key,value in dic.items():