def num_of_visited_nodes(driver_matrix):
    """ Calculate the total number of visited nodes for multiple paths.

    Args:
        driver_matrix (list of lists): A list whose members are lists that
        contain paths that are represented by consecutively visited nodes.
    Returns:
        int: Number of visited nodes
    """
    return sum(len(x) for x in driver_matrix)