l = input()

stack1 = []
stack2 = []

all_area = 0

for val in range(len(l)):
    if l[val] == "\\":
        stack1.append(val)
    elif l[val] == "/" and stack1 != []:
        temp = stack1.pop(-1)
        all_area = all_area + (val - temp)
        each_area = val - temp
        while stack2 != [] and stack2[-1][0] > temp:
            each_area = each_area + stack2.pop(-1)[1]

        stack2.append([temp, each_area])
    else:
        pass

print(all_area)
print(len(stack2), end="")

for i in range(len(stack2)):
    print(" ", end="")
    print(stack2[i][1],end="")

print("")
 l = input() l input() input stack1 = [] stack1 [] stack2 = [] stack2 [] all_area = 0 all_area 0 for val in range(len(l)):
    if l[val] == "\\":
        stack1.append(val)
    elif l[val] == "/" and stack1 != []:
        temp = stack1.pop(-1)
        all_area = all_area + (val - temp)
        each_area = val - temp
        while stack2 != [] and stack2[-1][0] > temp:
            each_area = each_area + stack2.pop(-1)[1]

        stack2.append([temp, each_area])
    else:
        pass val range(len(l)) range len(l) len l if l[val] == "\\":
        stack1.append(val)
    elif l[val] == "/" and stack1 != []:
        temp = stack1.pop(-1)
        all_area = all_area + (val - temp)
        each_area = val - temp
        while stack2 != [] and stack2[-1][0] > temp:
            each_area = each_area + stack2.pop(-1)[1]

        stack2.append([temp, each_area])
    else:
        pass l[val] == "\\" l[val] l val "\\" stack1.append(val) stack1.append stack1 append val elif l[val] == "/" and stack1 != []:
        temp = stack1.pop(-1)
        all_area = all_area + (val - temp)
        each_area = val - temp
        while stack2 != [] and stack2[-1][0] > temp:
            each_area = each_area + stack2.pop(-1)[1]

        stack2.append([temp, each_area])
     l[val] == "/" and stack1 != [] l[val] == "/" l[val] l val "/" stack1 != [] stack1 [] temp = stack1.pop(-1) temp stack1.pop(-1) stack1.pop stack1 pop -1 all_area = all_area + (val - temp) all_area all_area + (val - temp) all_area val - temp val temp each_area = val - temp each_area val - temp val temp while stack2 != [] and stack2[-1][0] > temp:
            each_area = each_area + stack2.pop(-1)[1]

         stack2 != [] and stack2[-1][0] > temp stack2 != [] stack2 [] stack2[-1][0] > temp stack2[-1][0] [-1] stack2 -1 0 temp each_area = each_area + stack2.pop(-1)[1] each_area each_area + stack2.pop(-1)[1] each_area stack2.pop(-1)[1] stack2.pop(-1) stack2.pop stack2 pop -1 1 stack2.append([temp, each_area]) stack2.append stack2 append [temp, each_area] temp each_area print(all_area) print all_area print(len(stack2), end="") print len(stack2) len stack2 end="" end "" for i in range(len(stack2)):
    print(" ", end="")
    print(stack2[i][1],end="") i range(len(stack2)) range len(stack2) len stack2 print(" ", end="") print " " end="" end "" print(stack2[i][1],end="") print stack2[i][1] [i] stack2 i 1 end="" end "" print("") print "" each_area = val - temp val - temp each_area each_area = each_area + stack2.pop(-1)[1] each_area + stack2.pop(-1)[1] each_area stack2 = [] [] stack2 l = input() input() l all_area = 0 0 all_area all_area = all_area + (val - temp) all_area + (val - temp) all_area stack1 = [] [] stack1 temp = stack1.pop(-1) stack1.pop(-1) temp
l = input()

stack1 = []
stack2 = []

all_area = 0

for val in range(len(l)):
    if l[val] == "\\":
        stack1.append(val)
    elif l[val] == "/" and stack1 != []:
        temp = stack1.pop(-1)
        all_area = all_area + (val - temp)
        each_area = val - temp
        while stack2 != [] and stack2[-1][0] > temp:
            each_area = each_area + stack2.pop(-1)[1]

        stack2.append([temp, each_area])
    else:
        pass

print(all_area)
print(len(stack2), end="")

for i in range(len(stack2)):
    print(" ", end="")
    print(stack2[i][1],end="")

print("")

