class stack():
    def __init__(self):
        self.S = []
        
    def push(self, x):
        self.S.append(x)
        
    def pop(self):
        return self.S.pop()
        
    def isEmpty(self):
        if len(self.S) == 0:
            return True
        else:
            return False

areas = input()

S1 = stack()
S2 = stack()

for i, info in enumerate(areas):
    if info == '/':
        if S1.isEmpty():
            continue
        left = S1.pop()
        menseki = i - left
        while True:
            if S2.isEmpty():
                S2.push([menseki, left])
                break
            if S2.S[-1][1] < left:
                S2.push([menseki, left])
                break
            menseki += S2.pop()[0]
    elif info == '\\':
        S1.push(i)

ans = [m[0] for m in S2.S]
print(sum(ans))
if len(ans) == 0:
    print(len(ans))
else:
    print(len(ans), ' '.join(list(map(str, ans)))) class stack():
    def __init__(self):
        self.S = []
        
    def push(self, x):
        self.S.append(x)
        
    def pop(self):
        return self.S.pop()
        
    def isEmpty(self):
        if len(self.S) == 0:
            return True
        else:
            return False stack def __init__(self):
        self.S = []
        
     __init__ self.S = [] self.S self S [] self self def push(self, x):
        self.S.append(x)
        
     push self.S.append(x) self.S.append self.S self S append x self self x x def pop(self):
        return self.S.pop()
        
     pop return self.S.pop() self.S.pop() self.S.pop self.S self S pop self self def isEmpty(self):
        if len(self.S) == 0:
            return True
        else:
            return False isEmpty if len(self.S) == 0:
            return True
        else:
            return False len(self.S) == 0 len(self.S) len self.S self S 0 return True True return False False self self areas = input() areas input() input S1 = stack() S1 stack() stack S2 = stack() S2 stack() stack for i, info in enumerate(areas):
    if info == '/':
        if S1.isEmpty():
            continue
        left = S1.pop()
        menseki = i - left
        while True:
            if S2.isEmpty():
                S2.push([menseki, left])
                break
            if S2.S[-1][1] < left:
                S2.push([menseki, left])
                break
            menseki += S2.pop()[0]
    elif info == '\\':
        S1.push(i) i info enumerate(areas) enumerate areas if info == '/':
        if S1.isEmpty():
            continue
        left = S1.pop()
        menseki = i - left
        while True:
            if S2.isEmpty():
                S2.push([menseki, left])
                break
            if S2.S[-1][1] < left:
                S2.push([menseki, left])
                break
            menseki += S2.pop()[0]
    elif info == '\\':
        S1.push(i) info == '/' info '/' if S1.isEmpty():
            continue
         S1.isEmpty() S1.isEmpty S1 isEmpty continue left = S1.pop() left S1.pop() S1.pop S1 pop menseki = i - left menseki i - left i left while True:
            if S2.isEmpty():
                S2.push([menseki, left])
                break
            if S2.S[-1][1] < left:
                S2.push([menseki, left])
                break
            menseki += S2.pop()[0]
     True if S2.isEmpty():
                S2.push([menseki, left])
                break
             S2.isEmpty() S2.isEmpty S2 isEmpty S2.push([menseki, left]) S2.push S2 push [menseki, left] menseki left break if S2.S[-1][1] < left:
                S2.push([menseki, left])
                break
             S2.S[-1][1] < left S2.S[-1][1] S2.S[-1] S2.S S2 S -1 1 left S2.push([menseki, left]) S2.push S2 push [menseki, left] menseki left break menseki += S2.pop()[0] menseki S2.pop()[0] S2.pop() S2.pop S2 pop 0 elif info == '\\':
        S1.push(i) info == '\\' info '\\' S1.push(i) S1.push S1 push i m[0] for m in S2.S for m in S2.S m S2.S S2 S for m in S2.S m[0] m 0 ans = [m[0] for m in S2.S] ans [m[0] for m in S2.S] print(sum(ans)) print sum(ans) sum ans if len(ans) == 0:
    print(len(ans))
else:
    print(len(ans), ' '.join(list(map(str, ans)))) len(ans) == 0 len(ans) len ans 0 print(len(ans)) print len(ans) len ans print(len(ans), ' '.join(list(map(str, ans)))) print len(ans) len ans ' '.join(list(map(str, ans))) ' '.join ' ' join list(map(str, ans)) list map(str, ans) map str ans areas = input() input() areas S1 = stack() stack() S1 class stack():
    def __init__(self):
        self.S = []
        
    def push(self, x):
        self.S.append(x)
        
    def pop(self):
        return self.S.pop()
        
    def isEmpty(self):
        if len(self.S) == 0:
            return True
        else:
            return False class stack():
    def __init__(self):
        self.S = []
        
    def push(self, x):
        self.S.append(x)
        
    def pop(self):
        return self.S.pop()
        
    def isEmpty(self):
        if len(self.S) == 0:
            return True
        else:
            return False stack S2 = stack() stack() S2 left = S1.pop() S1.pop() left ans = [m[0] for m in S2.S] [m[0] for m in S2.S] ans menseki += S2.pop()[0] S2.pop()[0] menseki menseki = i - left i - left menseki
class stack():
    def __init__(self):
        self.S = []
        
    def push(self, x):
        self.S.append(x)
        
    def pop(self):
        return self.S.pop()
        
    def isEmpty(self):
        if len(self.S) == 0:
            return True
        else:
            return False

areas = input()

S1 = stack()
S2 = stack()

for i, info in enumerate(areas):
    if info == '/':
        if S1.isEmpty():
            continue
        left = S1.pop()
        menseki = i - left
        while True:
            if S2.isEmpty():
                S2.push([menseki, left])
                break
            if S2.S[-1][1] < left:
                S2.push([menseki, left])
                break
            menseki += S2.pop()[0]
    elif info == '\\':
        S1.push(i)

ans = [m[0] for m in S2.S]
print(sum(ans))
if len(ans) == 0:
    print(len(ans))
else:
    print(len(ans), ' '.join(list(map(str, ans))))
