=MAX(MAP(A1:A9,LAMBDA(X,IFERROR(LEN(REGEXP(TEXTJOIN(,,DROP(MAP(ROW(1:9),LAMBDA(a,OFFSET(X,a-1,a-1))),-ROW(X)+1)),"^[1]+$")),0))),MAP(A1:I1,LAMBDA(X,IFERROR(LEN(REGEXP(TEXTJOIN(,,DROP(MAP(ROW(1:9),LAMBDA(a,OFFSET(X,a-1,a-1))),-ROW(X)+1)),"^[1]+$")),0))))