you can try this amybe this is what you want.
Data is in B4 and formula is in H4.
=SUMPRODUCT(IFERROR(MID(B4,--(FREQUENCY(--(MID(B4,ROW(INDIRECT("1:"&LEN(B4))),1)="-")*ROW(INDIRECT("1:"&LEN(B4))),--(MID(B4,ROW(INDIRECT("1:"&LEN(B4))),1)<>"-")*ROW(INDIRECT("1:"&LEN(B4))))=1)*ROW(INDIRECT("1:"&LEN(B4)+1)),1)+0,0))
This formula returns a '0'. I have changed the B4 to be V2 as this is the first cell where my data is currently sitting.