def num_instrs_of_type(soln, instr_type):
    """Return the number of non-arrow instructions of the given type in the solution."""
    return sum(1
               for reactor in soln.reactors
               for waldo in reactor.waldos
               for _, cmd in waldo.instr_map.values()
               if cmd is not None and cmd.type == instr_type)