from collections import Counter

n = int(raw_input())
words = [raw_input().strip() for x in range(n)]
counts = Counter(words)

print len(counts)

for word in words:
    d = counts.pop(word, None)
    if d == None:
        continue
    else:
        print d, 


Sample Input

4
bcdef
abcdefg
bcde
bcdef
Sample Output

3
2 1 1

0bae0e61136fa0cc0d0ed6ba396c5904e6513920
from collections import Counter

n = int(raw_input())
words = [raw_input().strip() for x in range(n)]
counts = Counter(words)

print len(counts)

for word in words:
    d = counts.pop(word, None)
    if d == None:
        continue
    else:
        print d, 


Sample Input

4
bcdef
abcdefg
bcde
bcdef
Sample Output

3
2 1 1
