p q l=sum[1|i<-l,q i>=0] v c l|(h,_:t)<-break(==c)l=[h,t] d[a,b,c,d]|ap e).map((map read.v '-'=<<).v ',').lines