import collections


def multiplicities(iterable):
    """Count the number of singletons, the number of duplicates, etc.
    Returns a collections.Counter instance."""
    return collections.Counter(collections.Counter(iterable).values())