I want a formula that gives the sum of first 12 from first non zero, without using an array formula.

So for example the formula would get 12 from a row with any of the below sequences

00111111111111
11111111111100
11001111111111

and of course something like the below would give 3

00110000000001
001100000000011111

I think I found a non array version online once - but I'm afraid my googling is failing me.