def count(target, collection, key):
    """Total target count on collection.

    :param key: callable to get the comparison value
    """
    occurences = sum([(1) for item in collection if key(item) == key(target)])
    return occurences
