Long distance LED chaser design
You can implement a GetSlaveCountCommand.  You send the command to OUT channel.  That slave on OUT channel will answer with its "child" count.  When being asked, you answer "child" count of your slave +1.  You only need to implement a RX on master.

If you change your chaining to create a ring, you can also implement a chirp command where Master sends 0 to slave 1.  Slave 1 sends 1 to slave 2 and so on.  The last slave loops back to master.  You will get your count.  This technique is interesting because you can add another byte to indicate whether the chirp first started from master.  If not, you actual counter value indicates which slave is orphaned.

By example, if you have 5 slave and, master would expect to receive 5.  If connection between slave 3 and 4 is broken, slave 4 will send 1 (with flag indicating not from master), 5 will send (2 with not from master flag) and master will know that 2nd slave in a 0-indexed mode from end is disconnected from the chain.  When all slaves are connected correctly, master receives 5 and not from master flag won't be set, so it is actual count.

If you use only a single UART port for this slave 1 tx to slave 2 rx; slave 2 tx to slave 3 rx and so on, it will take exactly the same amount of wiring and you will get your feedback back to master with device failure detection.