def nested_sum(matrix: list) -> int:
    """Takes a list of lists and adds up all the elements from the nested lists.
    """
    accumulator = 0
    
    for list in matrix:
        for element in list:
            accumulator = accumulator + element
    
    return accumulator