How to count the number of interface connections?

I have multiple broadband outlets, but due to the connection limit of the operator, the limit for each broadband outlet is different. I want to count the current connection number of the interface, so that I can use a script to process which outlet the terminal chooses.

Something like Per connection classifier - RouterOS - MikroTik Documentation ?