def calc(list):
    #print list
    d = 0
    a = 0.0
    for c in list:
        if c == "\\":
            d += 1
            a += d - 1 + 0.5
        elif c == "_":
            a += d
        else:
            a += d - 1 + 0.5
            d -= 1
    return a

if __name__ == "__main__":
    line = raw_input()
    areas = []
    mode = False
    d = 0
    edge = 0
    for i in range(len(line)):
        #print i, line[i], d, edge, mode
        c = line[i]
        if mode:
            if c == "\\":
                d += 1
            elif c == "/":
                d -= 1
                if d == 0:
                    areas.append(calc(line[edge:i + 1]))
                    mode = False
        else:
            if c == "\\":
                d += 1
                edge = i
                mode = True
            elif c == "_":
                edge = i
            else:
                edge = i

    last = len(areas)
    high = edge
    if d != 0:
        d = 0
        edge = len(line) - 1
        mode = False
        for i in range(len(line) - 1 , high - 1, -1):
            #print i, line[i], d, edge, mode
            c = line[i]
            if mode:
                if c == "/":
                    d += 1
                elif c == "\\":
                    d -= 1
                    if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
            else:
                if c == "/":
                    d += 1
                    edge = i
                    mode = True
                elif c == "_":
                    edge = i
                else:
                    edge = i

    if len(areas) == 0:
        print 0
        print 0
    else:
        areas = map(int, areas)
        print sum(areas)
        print len(areas),
        for i in range(len(areas) - 1):
            print areas[i],
        print areas[len(areas) - 1] def calc(list):
    #print list
    d = 0
    a = 0.0
    for c in list:
        if c == "\\":
            d += 1
            a += d - 1 + 0.5
        elif c == "_":
            a += d
        else:
            a += d - 1 + 0.5
            d -= 1
    return a calc d = 0 d 0 a = 0.0 a 0.0 for c in list:
        if c == "\\":
            d += 1
            a += d - 1 + 0.5
        elif c == "_":
            a += d
        else:
            a += d - 1 + 0.5
            d -= 1
     c list if c == "\\":
            d += 1
            a += d - 1 + 0.5
        elif c == "_":
            a += d
        else:
            a += d - 1 + 0.5
            d -= 1
     c == "\\" c "\\" d += 1 d 1 a += d - 1 + 0.5 a d - 1 + 0.5 d - 1 d 1 0.5 elif c == "_":
            a += d
         c == "_" c "_" a += d a d a += d - 1 + 0.5 a d - 1 + 0.5 d - 1 d 1 0.5 d -= 1 d 1 return a a list list if __name__ == "__main__":
    line = raw_input()
    areas = []
    mode = False
    d = 0
    edge = 0
    for i in range(len(line)):
        #print i, line[i], d, edge, mode
        c = line[i]
        if mode:
            if c == "\\":
                d += 1
            elif c == "/":
                d -= 1
                if d == 0:
                    areas.append(calc(line[edge:i + 1]))
                    mode = False
        else:
            if c == "\\":
                d += 1
                edge = i
                mode = True
            elif c == "_":
                edge = i
            else:
                edge = i

    last = len(areas)
    high = edge
    if d != 0:
        d = 0
        edge = len(line) - 1
        mode = False
        for i in range(len(line) - 1 , high - 1, -1):
            #print i, line[i], d, edge, mode
            c = line[i]
            if mode:
                if c == "/":
                    d += 1
                elif c == "\\":
                    d -= 1
                    if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
            else:
                if c == "/":
                    d += 1
                    edge = i
                    mode = True
                elif c == "_":
                    edge = i
                else:
                    edge = i

    if len(areas) == 0:
        print 0
        print 0
    else:
        areas = map(int, areas)
        print sum(areas)
        print len(areas),
        for i in range(len(areas) - 1):
            print areas[i],
        print areas[len(areas) - 1] __name__ == "__main__" __name__ "__main__" line = raw_input() line raw_input() raw_input areas = [] areas [] mode = False mode False d = 0 d 0 edge = 0 edge 0 for i in range(len(line)):
        #print i, line[i], d, edge, mode
        c = line[i]
        if mode:
            if c == "\\":
                d += 1
            elif c == "/":
                d -= 1
                if d == 0:
                    areas.append(calc(line[edge:i + 1]))
                    mode = False
        else:
            if c == "\\":
                d += 1
                edge = i
                mode = True
            elif c == "_":
                edge = i
            else:
                edge = i

     i range(len(line)) range len(line) len line c = line[i] c line[i] line i if mode:
            if c == "\\":
                d += 1
            elif c == "/":
                d -= 1
                if d == 0:
                    areas.append(calc(line[edge:i + 1]))
                    mode = False
        else:
            if c == "\\":
                d += 1
                edge = i
                mode = True
            elif c == "_":
                edge = i
            else:
                edge = i

     mode if c == "\\":
                d += 1
            elif c == "/":
                d -= 1
                if d == 0:
                    areas.append(calc(line[edge:i + 1]))
                    mode = False
         c == "\\" c "\\" d += 1 d 1 elif c == "/":
                d -= 1
                if d == 0:
                    areas.append(calc(line[edge:i + 1]))
                    mode = False
         c == "/" c "/" d -= 1 d 1 if d == 0:
                    areas.append(calc(line[edge:i + 1]))
                    mode = False
         d == 0 d 0 areas.append(calc(line[edge:i + 1])) areas.append areas append calc(line[edge:i + 1]) calc line[edge:i + 1] line edge:i + 1 edge i + 1 i 1 mode = False mode False if c == "\\":
                d += 1
                edge = i
                mode = True
            elif c == "_":
                edge = i
            else:
                edge = i

     c == "\\" c "\\" d += 1 d 1 edge = i edge i mode = True mode True elif c == "_":
                edge = i
             c == "_" c "_" edge = i edge i edge = i edge i last = len(areas) last len(areas) len areas high = edge high edge if d != 0:
        d = 0
        edge = len(line) - 1
        mode = False
        for i in range(len(line) - 1 , high - 1, -1):
            #print i, line[i], d, edge, mode
            c = line[i]
            if mode:
                if c == "/":
                    d += 1
                elif c == "\\":
                    d -= 1
                    if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
            else:
                if c == "/":
                    d += 1
                    edge = i
                    mode = True
                elif c == "_":
                    edge = i
                else:
                    edge = i

     d != 0 d 0 d = 0 d 0 edge = len(line) - 1 edge len(line) - 1 len(line) len line 1 mode = False mode False for i in range(len(line) - 1 , high - 1, -1):
            #print i, line[i], d, edge, mode
            c = line[i]
            if mode:
                if c == "/":
                    d += 1
                elif c == "\\":
                    d -= 1
                    if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
            else:
                if c == "/":
                    d += 1
                    edge = i
                    mode = True
                elif c == "_":
                    edge = i
                else:
                    edge = i

     i range(len(line) - 1 , high - 1, -1) range len(line) - 1 len(line) len line 1 high - 1 high 1 -1 c = line[i] c line[i] line i if mode:
                if c == "/":
                    d += 1
                elif c == "\\":
                    d -= 1
                    if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
            else:
                if c == "/":
                    d += 1
                    edge = i
                    mode = True
                elif c == "_":
                    edge = i
                else:
                    edge = i

     mode if c == "/":
                    d += 1
                elif c == "\\":
                    d -= 1
                    if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
             c == "/" c "/" d += 1 d 1 elif c == "\\":
                    d -= 1
                    if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
             c == "\\" c "\\" d -= 1 d 1 if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
             d == 0 d 0 areas.insert(last, calc(line[i:edge + 1])) areas.insert areas insert last calc(line[i:edge + 1]) calc line[i:edge + 1] line i:edge + 1 i edge + 1 edge 1 mode = False mode False if c == "/":
                    d += 1
                    edge = i
                    mode = True
                elif c == "_":
                    edge = i
                else:
                    edge = i

     c == "/" c "/" d += 1 d 1 edge = i edge i mode = True mode True elif c == "_":
                    edge = i
                 c == "_" c "_" edge = i edge i edge = i edge i if len(areas) == 0:
        print 0
        print 0
    else:
        areas = map(int, areas)
        print sum(areas)
        print len(areas),
        for i in range(len(areas) - 1):
            print areas[i],
        print areas[len(areas) - 1] len(areas) == 0 len(areas) len areas 0 print print areas = map(int, areas) areas map(int, areas) map int areas print sum(areas) sum areas print len(areas) len areas for i in range(len(areas) - 1):
            print areas[i],
         i range(len(areas) - 1) range len(areas) - 1 len(areas) len areas 1 print areas[i] areas i print areas[len(areas) - 1] areas len(areas) - 1 len(areas) len areas 1 high = edge edge high d += 1 1 d d -= 1 1 d d = 0 0 d edge = i i edge mode = False False mode d += 1 1 d d += 1 1 d areas = [] [] areas d -= 1 1 d edge = i i edge edge = i i edge edge = len(line) - 1 len(line) - 1 edge c = line[i] line[i] c mode = True True mode c = line[i] line[i] c d += 1 1 d edge = i i edge line = raw_input() raw_input() line d = 0 0 d edge = 0 0 edge mode = False False mode def calc(list):
    #print list
    d = 0
    a = 0.0
    for c in list:
        if c == "\\":
            d += 1
            a += d - 1 + 0.5
        elif c == "_":
            a += d
        else:
            a += d - 1 + 0.5
            d -= 1
    return a def calc(list):
    #print list
    d = 0
    a = 0.0
    for c in list:
        if c == "\\":
            d += 1
            a += d - 1 + 0.5
        elif c == "_":
            a += d
        else:
            a += d - 1 + 0.5
            d -= 1
    return a calc last = len(areas) len(areas) last mode = True True mode edge = i i edge mode = False False mode edge = i i edge areas = map(int, areas) map(int, areas) areas mode = False False mode
def calc(list):
    #print list
    d = 0
    a = 0.0
    for c in list:
        if c == "\\":
            d += 1
            a += d - 1 + 0.5
        elif c == "_":
            a += d
        else:
            a += d - 1 + 0.5
            d -= 1
    return a

if __name__ == "__main__":
    line = raw_input()
    areas = []
    mode = False
    d = 0
    edge = 0
    for i in range(len(line)):
        #print i, line[i], d, edge, mode
        c = line[i]
        if mode:
            if c == "\\":
                d += 1
            elif c == "/":
                d -= 1
                if d == 0:
                    areas.append(calc(line[edge:i + 1]))
                    mode = False
        else:
            if c == "\\":
                d += 1
                edge = i
                mode = True
            elif c == "_":
                edge = i
            else:
                edge = i

    last = len(areas)
    high = edge
    if d != 0:
        d = 0
        edge = len(line) - 1
        mode = False
        for i in range(len(line) - 1 , high - 1, -1):
            #print i, line[i], d, edge, mode
            c = line[i]
            if mode:
                if c == "/":
                    d += 1
                elif c == "\\":
                    d -= 1
                    if d == 0:
                        #print i, edge
                        areas.insert(last, calc(line[i:edge + 1]))
                        mode = False
            else:
                if c == "/":
                    d += 1
                    edge = i
                    mode = True
                elif c == "_":
                    edge = i
                else:
                    edge = i

    if len(areas) == 0:
        print 0
        print 0
    else:
        areas = map(int, areas)
        print sum(areas)
        print len(areas),
        for i in range(len(areas) - 1):
            print areas[i],
        print areas[len(areas) - 1]