For the count, I would have a series of pumps between channels, started by (reverse ordered) pump-triggers on the track.
In fact, 'simplest', have twelve thirteen pumps between each of twelve thirteen channels. No, make it fourteen, for obvious design reasons. When minecart rolls round, it triggers the 'final' pump to suck any liquid compleyely out of its source and shoved it into its sink-channel. Shortly after, minecart activates penultimate pump to take from its source and put into its sink (final pump's source, but final pump now stopped, so it stays). Repeat for remaining pumps in contrary order.
(As 'first' pump in chain would operate after the 'last', if water transfers by the last it always transfers by the first, thus effectively two of the thirteen pumps act as one. But due to geometry, 13 'links' don't link up. Make it 14 with three pumps ("two last ones/one first" or "one last/two first" configuration) and a 12-step chain with a single three-pump step in it would work. IYSWIM.)
Put sensor plates in the appropriate channels (#s 1 and 7, by effective convention) to send the on/off signal to the protective architecture, et voila...
Perhaps (a different kind of) simpler is 24 pumps, in a circuit. Only two minecart triggers. One starts every other pump (from the twelve sink/source pits into the twelve transition pits, if there's anything to draw), the second activates when the first has ended to activate the alternate pumps (transition pits to next sink/source one). Each minecart run thus, again, advances a physical counter around a circuit in a measurable way.
I've not yet combined minecart logic with fluid logic, but that should suffice. From my experiments with Tetris emulation via fluid logic alone...