# coding: utf-8
s = list(input().rstrip())
ht = []
ponds=[]
for i, ch in enumerate(s):
    if ch == "\\":
        ht.append(i)
    elif ch == "/":
        if ht:
            b = ht.pop()
            ap = i - b
            if not ponds:
                ponds.append([b, ap])
            else:
                while ponds:
                    p = ponds.pop()
                    if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                ponds.append([b,ap])
    else:
        pass

ans = ""
area = 0
for point, ar in ponds:
    area += ar
    ans += " "
    ans += str(ar)
print(area)
print(str(len(ponds)) + ans) s = list(input().rstrip()) s list(input().rstrip()) list input().rstrip() ().rstrip () input rstrip ht = [] ht [] ponds=[] ponds [] for i, ch in enumerate(s):
    if ch == "\\":
        ht.append(i)
    elif ch == "/":
        if ht:
            b = ht.pop()
            ap = i - b
            if not ponds:
                ponds.append([b, ap])
            else:
                while ponds:
                    p = ponds.pop()
                    if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                ponds.append([b,ap])
    else:
        pass i ch enumerate(s) enumerate s if ch == "\\":
        ht.append(i)
    elif ch == "/":
        if ht:
            b = ht.pop()
            ap = i - b
            if not ponds:
                ponds.append([b, ap])
            else:
                while ponds:
                    p = ponds.pop()
                    if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                ponds.append([b,ap])
    else:
        pass ch == "\\" ch "\\" ht.append(i) ht.append ht append i elif ch == "/":
        if ht:
            b = ht.pop()
            ap = i - b
            if not ponds:
                ponds.append([b, ap])
            else:
                while ponds:
                    p = ponds.pop()
                    if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                ponds.append([b,ap])
     ch == "/" ch "/" if ht:
            b = ht.pop()
            ap = i - b
            if not ponds:
                ponds.append([b, ap])
            else:
                while ponds:
                    p = ponds.pop()
                    if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                ponds.append([b,ap])
     ht b = ht.pop() b ht.pop() ht.pop ht pop ap = i - b ap i - b i b if not ponds:
                ponds.append([b, ap])
            else:
                while ponds:
                    p = ponds.pop()
                    if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                ponds.append([b,ap])
     not ponds ponds ponds.append([b, ap]) ponds.append ponds append [b, ap] b ap while ponds:
                    p = ponds.pop()
                    if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                 ponds p = ponds.pop() p ponds.pop() ponds.pop ponds pop if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                 p[0] > b p[0] p 0 b ap += p[1] ap p[1] p 1 ponds.append([p[0],p[1]]) ponds.append ponds append [p[0],p[1]] p[0] p 0 p[1] p 1 break ponds.append([b,ap]) ponds.append ponds append [b,ap] b ap ans = "" ans "" area = 0 area 0 for point, ar in ponds:
    area += ar
    ans += " "
    ans += str(ar) point ar ponds area += ar area ar ans += " " ans " " ans += str(ar) ans str(ar) str ar print(area) print area print(str(len(ponds)) + ans) print str(len(ponds)) + ans str(len(ponds)) str len(ponds) len ponds ans ans = "" "" ans ht = [] [] ht ans += " " " " ans ap += p[1] p[1] ap area += ar ar area s = list(input().rstrip()) list(input().rstrip()) s b = ht.pop() ht.pop() b ans += str(ar) str(ar) ans ponds=[] [] ponds p = ponds.pop() ponds.pop() p area = 0 0 area ap = i - b i - b ap
# coding: utf-8
s = list(input().rstrip())
ht = []
ponds=[]
for i, ch in enumerate(s):
    if ch == "\\":
        ht.append(i)
    elif ch == "/":
        if ht:
            b = ht.pop()
            ap = i - b
            if not ponds:
                ponds.append([b, ap])
            else:
                while ponds:
                    p = ponds.pop()
                    if p[0] > b:
                        ap += p[1]
                    else:
                        ponds.append([p[0],p[1]])
                        break
                ponds.append([b,ap])
    else:
        pass

ans = ""
area = 0
for point, ar in ponds:
    area += ar
    ans += " "
    ans += str(ar)
print(area)
print(str(len(ponds)) + ans)
