A = 0
left = []
Lake = []
s = input()
for i in range(len(s)):
    if s[i] == "\\":
        left.append(i)
    elif s[i] == "/":
        if len(left) > 0:
            w = left.pop()
            goukei = i - w
            A += goukei
            for i in range(len(Lake)-1,-1,-1):
                if Lake[i][0] > w:
                    x = Lake.pop()
                    goukei += x[1]
            Lake.append([w, goukei])
print(A)
if len(Lake) == 0:
    print(0)
else:
    print(len(Lake),end=" ")
for i in range(len(Lake)):
    if i == len(Lake) - 1:
        print(Lake[i][1])
    else:
        print(Lake[i][1],end=" ") A = 0 A 0 left = [] left [] Lake = [] Lake [] s = input() s input() input for i in range(len(s)):
    if s[i] == "\\":
        left.append(i)
    elif s[i] == "/":
        if len(left) > 0:
            w = left.pop()
            goukei = i - w
            A += goukei
            for i in range(len(Lake)-1,-1,-1):
                if Lake[i][0] > w:
                    x = Lake.pop()
                    goukei += x[1]
            Lake.append([w, goukei]) i range(len(s)) range len(s) len s if s[i] == "\\":
        left.append(i)
    elif s[i] == "/":
        if len(left) > 0:
            w = left.pop()
            goukei = i - w
            A += goukei
            for i in range(len(Lake)-1,-1,-1):
                if Lake[i][0] > w:
                    x = Lake.pop()
                    goukei += x[1]
            Lake.append([w, goukei]) s[i] == "\\" s[i] s i "\\" left.append(i) left.append left append i elif s[i] == "/":
        if len(left) > 0:
            w = left.pop()
            goukei = i - w
            A += goukei
            for i in range(len(Lake)-1,-1,-1):
                if Lake[i][0] > w:
                    x = Lake.pop()
                    goukei += x[1]
            Lake.append([w, goukei]) s[i] == "/" s[i] s i "/" if len(left) > 0:
            w = left.pop()
            goukei = i - w
            A += goukei
            for i in range(len(Lake)-1,-1,-1):
                if Lake[i][0] > w:
                    x = Lake.pop()
                    goukei += x[1]
            Lake.append([w, goukei]) len(left) > 0 len(left) len left 0 w = left.pop() w left.pop() left.pop left pop goukei = i - w goukei i - w i w A += goukei A goukei for i in range(len(Lake)-1,-1,-1):
                if Lake[i][0] > w:
                    x = Lake.pop()
                    goukei += x[1]
             i range(len(Lake)-1,-1,-1) range len(Lake)-1 len(Lake) len Lake 1 -1 -1 if Lake[i][0] > w:
                    x = Lake.pop()
                    goukei += x[1]
             Lake[i][0] > w Lake[i][0] [i] Lake i 0 w x = Lake.pop() x Lake.pop() Lake.pop Lake pop goukei += x[1] goukei x[1] x 1 Lake.append([w, goukei]) Lake.append Lake append [w, goukei] w goukei print(A) print A if len(Lake) == 0:
    print(0)
else:
    print(len(Lake),end=" ") len(Lake) == 0 len(Lake) len Lake 0 print(0) print 0 print(len(Lake),end=" ") print len(Lake) len Lake end=" " end " " for i in range(len(Lake)):
    if i == len(Lake) - 1:
        print(Lake[i][1])
    else:
        print(Lake[i][1],end=" ") i range(len(Lake)) range len(Lake) len Lake if i == len(Lake) - 1:
        print(Lake[i][1])
    else:
        print(Lake[i][1],end=" ") i == len(Lake) - 1 i len(Lake) - 1 len(Lake) len Lake 1 print(Lake[i][1]) print Lake[i][1] [i] Lake i 1 print(Lake[i][1],end=" ") print Lake[i][1] [i] Lake i 1 end=" " end " " w = left.pop() left.pop() w s = input() input() s goukei = i - w i - w goukei A += goukei goukei A left = [] [] left Lake = [] [] Lake goukei += x[1] x[1] goukei A = 0 0 A x = Lake.pop() Lake.pop() x
A = 0
left = []
Lake = []
s = input()
for i in range(len(s)):
    if s[i] == "\\":
        left.append(i)
    elif s[i] == "/":
        if len(left) > 0:
            w = left.pop()
            goukei = i - w
            A += goukei
            for i in range(len(Lake)-1,-1,-1):
                if Lake[i][0] > w:
                    x = Lake.pop()
                    goukei += x[1]
            Lake.append([w, goukei])
print(A)
if len(Lake) == 0:
    print(0)
else:
    print(len(Lake),end=" ")
for i in range(len(Lake)):
    if i == len(Lake) - 1:
        print(Lake[i][1])
    else:
        print(Lake[i][1],end=" ")