g = list(input())

sum, d, r, p = 0, 0, 0, 0
f = 0
lake_list = []

for c in g:
    if c == "\\":
        if f == 0:
            f, d, r = 1, 1, 1
        else:
            d += 1
            r += (1 + (d-1))
    elif c == "_":
        if f == 1:
            r += d
    else:
        if f == 1:
            d -= 1
            r += d
            if d == 0:
                f = 0
                sum += r
                lake_list.append([p, r])
                r = 0
    p += 1

d, r, p = 0, 0, len(g)-1
f = 0
g.reverse()

for c in g:
    if c == "/":
        if f == 0:
            f, d, r = 1, 1, 1
            pr = p
        else:
            d += 1
            r += (1 + (d-1))
    elif c == "_":
        if f == 1:
            r += d
    else:
        if f == 1:
            d -= 1
            r += d
            if d == 0:
                if [pr, r] not in lake_list:
                    sum += r
                    lake_list.append([pr, r])
                f = 0
                r = 0
    p -= 1

lake_list.sort()
print(sum)
print(len(lake_list), end="")
i = 0
while i != len(lake_list):
    print(" {}".format(lake_list[i][1]), end="")
    i += 1
print()
 g = list(input()) g list(input()) list input() input sum, d, r, p = 0, 0, 0, 0 sum 0 d 0 r 0 p 0 f = 0 f 0 lake_list = [] lake_list [] for c in g:
    if c == "\\":
        if f == 0:
            f, d, r = 1, 1, 1
        else:
            d += 1
            r += (1 + (d-1))
    elif c == "_":
        if f == 1:
            r += d
    else:
        if f == 1:
            d -= 1
            r += d
            if d == 0:
                f = 0
                sum += r
                lake_list.append([p, r])
                r = 0
    p += 1 c g if c == "\\":
        if f == 0:
            f, d, r = 1, 1, 1
        else:
            d += 1
            r += (1 + (d-1))
    elif c == "_":
        if f == 1:
            r += d
    else:
        if f == 1:
            d -= 1
            r += d
            if d == 0:
                f = 0
                sum += r
                lake_list.append([p, r])
                r = 0
     c == "\\" c "\\" if f == 0:
            f, d, r = 1, 1, 1
        else:
            d += 1
            r += (1 + (d-1))
     f == 0 f 0 f, d, r = 1, 1, 1 f 1 d 1 r 1 d += 1 d 1 r += (1 + (d-1)) r 1 + (d-1) 1 d-1 d 1 elif c == "_":
        if f == 1:
            r += d
     c == "_" c "_" if f == 1:
            r += d
     f == 1 f 1 r += d r d if f == 1:
            d -= 1
            r += d
            if d == 0:
                f = 0
                sum += r
                lake_list.append([p, r])
                r = 0
     f == 1 f 1 d -= 1 d 1 r += d r d if d == 0:
                f = 0
                sum += r
                lake_list.append([p, r])
                r = 0
     d == 0 d 0 f = 0 f 0 sum += r sum r lake_list.append([p, r]) lake_list.append lake_list append [p, r] p r r = 0 r 0 p += 1 p 1 d, r, p = 0, 0, len(g)-1 d 0 r 0 p len(g)-1 len(g) len g 1 f = 0 f 0 g.reverse() g.reverse g reverse for c in g:
    if c == "/":
        if f == 0:
            f, d, r = 1, 1, 1
            pr = p
        else:
            d += 1
            r += (1 + (d-1))
    elif c == "_":
        if f == 1:
            r += d
    else:
        if f == 1:
            d -= 1
            r += d
            if d == 0:
                if [pr, r] not in lake_list:
                    sum += r
                    lake_list.append([pr, r])
                f = 0
                r = 0
    p -= 1 c g if c == "/":
        if f == 0:
            f, d, r = 1, 1, 1
            pr = p
        else:
            d += 1
            r += (1 + (d-1))
    elif c == "_":
        if f == 1:
            r += d
    else:
        if f == 1:
            d -= 1
            r += d
            if d == 0:
                if [pr, r] not in lake_list:
                    sum += r
                    lake_list.append([pr, r])
                f = 0
                r = 0
     c == "/" c "/" if f == 0:
            f, d, r = 1, 1, 1
            pr = p
        else:
            d += 1
            r += (1 + (d-1))
     f == 0 f 0 f, d, r = 1, 1, 1 f 1 d 1 r 1 pr = p pr p d += 1 d 1 r += (1 + (d-1)) r 1 + (d-1) 1 d-1 d 1 elif c == "_":
        if f == 1:
            r += d
     c == "_" c "_" if f == 1:
            r += d
     f == 1 f 1 r += d r d if f == 1:
            d -= 1
            r += d
            if d == 0:
                if [pr, r] not in lake_list:
                    sum += r
                    lake_list.append([pr, r])
                f = 0
                r = 0
     f == 1 f 1 d -= 1 d 1 r += d r d if d == 0:
                if [pr, r] not in lake_list:
                    sum += r
                    lake_list.append([pr, r])
                f = 0
                r = 0
     d == 0 d 0 if [pr, r] not in lake_list:
                    sum += r
                    lake_list.append([pr, r])
                 [pr, r] not in lake_list [pr, r] pr r lake_list sum += r sum r lake_list.append([pr, r]) lake_list.append lake_list append [pr, r] pr r f = 0 f 0 r = 0 r 0 p -= 1 p 1 lake_list.sort() lake_list.sort lake_list sort print(sum) print sum print(len(lake_list), end="") print len(lake_list) len lake_list end="" end "" i = 0 i 0 while i != len(lake_list):
    print(" {}".format(lake_list[i][1]), end="")
    i += 1 i != len(lake_list) i len(lake_list) len lake_list print(" {}".format(lake_list[i][1]), end="") print " {}".format(lake_list[i][1]) " {}".format " {}" format lake_list[i][1] [i] lake_list i 1 end="" end "" i += 1 i 1 print() print p = 0, 0, 0, 0 0 p f, d, r = 1, 1, 1 1 f f = 0 0 f f, d, r = 1, 1, 1 1 f r += (1 + (d-1)) 1 + (d-1) r sum += r r sum r += d d r sum, d, r, p = 0, 0, 0, 0 0 sum d += 1 1 d p -= 1 1 p d += 1 1 d p += 1 1 p r, p = 0, 0, len(g)-1 0 r g = list(input()) list(input()) g r = 1, 1, 1 1 r i += 1 1 i r, p = 0, 0, 0, 0 0 r lake_list = [] [] lake_list r = 1, 1, 1 1 r d, r = 1, 1, 1 1 d sum += r r sum i = 0 0 i d -= 1 1 d d -= 1 1 d r += d d r p = 0, 0, len(g)-1 len(g)-1 p f = 0 0 f d, r, p = 0, 0, 0, 0 0 d r += d d r r = 0 0 r d, r, p = 0, 0, len(g)-1 0 d pr = p p pr d, r = 1, 1, 1 1 d f = 0 0 f f = 0 0 f r += d d r r += (1 + (d-1)) 1 + (d-1) r r = 0 0 r
g = list(input())

sum, d, r, p = 0, 0, 0, 0
f = 0
lake_list = []

for c in g:
    if c == "\\":
        if f == 0:
            f, d, r = 1, 1, 1
        else:
            d += 1
            r += (1 + (d-1))
    elif c == "_":
        if f == 1:
            r += d
    else:
        if f == 1:
            d -= 1
            r += d
            if d == 0:
                f = 0
                sum += r
                lake_list.append([p, r])
                r = 0
    p += 1

d, r, p = 0, 0, len(g)-1
f = 0
g.reverse()

for c in g:
    if c == "/":
        if f == 0:
            f, d, r = 1, 1, 1
            pr = p
        else:
            d += 1
            r += (1 + (d-1))
    elif c == "_":
        if f == 1:
            r += d
    else:
        if f == 1:
            d -= 1
            r += d
            if d == 0:
                if [pr, r] not in lake_list:
                    sum += r
                    lake_list.append([pr, r])
                f = 0
                r = 0
    p -= 1

lake_list.sort()
print(sum)
print(len(lake_list), end="")
i = 0
while i != len(lake_list):
    print(" {}".format(lake_list[i][1]), end="")
    i += 1
print()

