from typing import Counter


def count_attributes(attribute_dict):
    """Count the number of times attributes are found in study metadata.

    Parameters
    ----------
    attribute_dict : dict
        Dictionary of study attributes, where keys are study identifiers
        and attributes are values found in the study metadata.

    Returns
    -------
    collections.Counter
        Counter giving the number of times each attribute appears in metadata
        to which the attribute_dict relates.
    """
    counter = Counter()
    for attributes in attribute_dict.values():
        counter += Counter(attributes)
    return counter