def countBags(bags, bag):
    """Counts the number of bags in the given bag.
    
    Done by recursively iterating through its contents.
    
    Parameters
    ----------
    bags: dict of str to dict of str to int
        The map of what bags contain what other bags.
    bag: str
        The bag to check.
    
    Returns
    -------
    int
        The total bag count. Includes the start bag.
    """
    count = 1
    for check in bags[bag].keys():
        count += countBags(bags, check) * bags[bag][check]

    return count