def num_arrows(soln):
    """Return the number of arrows in the solution."""
    return sum(1
               for reactor in soln.reactors
               for waldo in reactor.waldos
               for arrow, _ in waldo.instr_map.values()
               if arrow is not None)