def count_examples(taxonomy):
    """
    Get taxonomy, count examples in every node and return sum.

    :param taxonomy: taxonomy
    :return: sum of examples
    """
    count = 0
    keys = [x for x in list(taxonomy.keys()) if x != "data"]
    for i in keys:
        if set(taxonomy[i]) == set(list({"data"})):
            if i == keys[-1]:
                count += len(taxonomy[i]["data"])
                return count
            else:
                count += len(taxonomy[i]["data"])
        else:
            count += count_examples(taxonomy[i])
    return count