def completed_outputs(soln):
    """Given a Solution object that has run to completion or error, return the number of completed output molecules."""
    return sum(output.current_count for output in soln.outputs)