def count_occurences(ingredients, ingredient_count):
    """Count number of occurences of ingredients based on ingredient_count."""
    return sum(ingredient_count[ingredient] for ingredient in ingredients)