# -*- coding: utf-8 -*-

line = map(str, raw_input())
place = 0
area = 0
stack1 = []
stack2 = []
for i in line:
    if i == '\\':
        stack1.append(place)
    elif i == '/':
        if len(stack1) != 0:
            j = stack1.pop()
            s = place-j
            area += s
            while len(stack2) != 0:
                if stack2[-1][0] <= j:
                    break
                tmp = stack2.pop()
                s += tmp[1]
            stack2.append([j, s])
    place += 1
print area
temp = []
for a in stack2:
    temp.append(a[1])
if len(stack2) > 0:
    print len(stack2),
    print " ".join(map(str, temp))
else:
    print len(stack2) line = map(str, raw_input()) line map(str, raw_input()) map str raw_input() raw_input place = 0 place 0 area = 0 area 0 stack1 = [] stack1 [] stack2 = [] stack2 [] for i in line:
    if i == '\\':
        stack1.append(place)
    elif i == '/':
        if len(stack1) != 0:
            j = stack1.pop()
            s = place-j
            area += s
            while len(stack2) != 0:
                if stack2[-1][0] <= j:
                    break
                tmp = stack2.pop()
                s += tmp[1]
            stack2.append([j, s])
    place += 1 i line if i == '\\':
        stack1.append(place)
    elif i == '/':
        if len(stack1) != 0:
            j = stack1.pop()
            s = place-j
            area += s
            while len(stack2) != 0:
                if stack2[-1][0] <= j:
                    break
                tmp = stack2.pop()
                s += tmp[1]
            stack2.append([j, s])
     i == '\\' i '\\' stack1.append(place) stack1.append stack1 append place elif i == '/':
        if len(stack1) != 0:
            j = stack1.pop()
            s = place-j
            area += s
            while len(stack2) != 0:
                if stack2[-1][0] <= j:
                    break
                tmp = stack2.pop()
                s += tmp[1]
            stack2.append([j, s])
     i == '/' i '/' if len(stack1) != 0:
            j = stack1.pop()
            s = place-j
            area += s
            while len(stack2) != 0:
                if stack2[-1][0] <= j:
                    break
                tmp = stack2.pop()
                s += tmp[1]
            stack2.append([j, s])
     len(stack1) != 0 len(stack1) len stack1 0 j = stack1.pop() j stack1.pop() stack1.pop stack1 pop s = place-j s place-j place j area += s area s while len(stack2) != 0:
                if stack2[-1][0] <= j:
                    break
                tmp = stack2.pop()
                s += tmp[1]
             len(stack2) != 0 len(stack2) len stack2 0 if stack2[-1][0] <= j:
                    break
                 stack2[-1][0] <= j stack2[-1][0] [-1] stack2 -1 0 j break tmp = stack2.pop() tmp stack2.pop() stack2.pop stack2 pop s += tmp[1] s tmp[1] tmp 1 stack2.append([j, s]) stack2.append stack2 append [j, s] j s place += 1 place 1 print temp = [] temp [] for a in stack2:
    temp.append(a[1]) a stack2 temp.append(a[1]) temp.append temp append a[1] a 1 if len(stack2) > 0:
    print len(stack2),
    print " ".join(map(str, temp))
else:
    print len(stack2) len(stack2) > 0 len(stack2) len stack2 0 print len(stack2) len stack2 print " ".join(map(str, temp)) " ".join " " join map(str, temp) map str temp print len(stack2) len stack2 line = map(str, raw_input()) map(str, raw_input()) line stack2 = [] [] stack2 place = 0 0 place s += tmp[1] tmp[1] s place += 1 1 place stack1 = [] [] stack1 j = stack1.pop() stack1.pop() j area = 0 0 area s = place-j place-j s area += s s area temp = [] [] temp tmp = stack2.pop() stack2.pop() tmp
# -*- coding: utf-8 -*-

line = map(str, raw_input())
place = 0
area = 0
stack1 = []
stack2 = []
for i in line:
    if i == '\\':
        stack1.append(place)
    elif i == '/':
        if len(stack1) != 0:
            j = stack1.pop()
            s = place-j
            area += s
            while len(stack2) != 0:
                if stack2[-1][0] <= j:
                    break
                tmp = stack2.pop()
                s += tmp[1]
            stack2.append([j, s])
    place += 1
print area
temp = []
for a in stack2:
    temp.append(a[1])
if len(stack2) > 0:
    print len(stack2),
    print " ".join(map(str, temp))
else:
    print len(stack2)