where countUntilClosed (x:xs)