#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_D
#?°´??????????????¢????¨????
import re

def cal_puddle(diagram_list):
    score = 0
    depth = 0
    
    for i, symbol in enumerate(diagram_list):
        
        if symbol == "\\":
            score += depth + 0.5
            depth += 1
        elif symbol == "/":
            depth = depth - 1
            score += depth + 0.5
        elif symbol == "_":
            score += depth
            continue
        
        if depth == 0:
            return int(score)

    return None

def cal(diagram):
    
    puddle_areas = []
    diagram_list = []

    puddle_list = []
    i = 0
    score = []
    while i < len(diagram):
        if diagram[i] == "\\":
            res = cal_puddle(diagram[i:])
            if res[1]:
                i = i + res[1]
                score.append(res[0])
        i += 1

    return score
def cal_revision(diagram):

    hight = 0
    hight_list = []
    hight_index_list = []
    in_puddle = False
    for i, s in enumerate(diagram + "\\"):
        if s == "\\":
            if not in_puddle:
                in_puddle = True
                hight_list.append(hight)
                hight_index_list.append(i)
            hight -= 1
        elif s == "/":
            in_puddle = False
            hight += 1

    puddle_list = []
    i = 0
    while i < len(hight_list) - 1:
        if hight_list[i] <= hight_list[i + 1]:
            puddle_list.append((hight_index_list[i], hight_index_list[i + 1]))
            i = i + 1
        else:
            hight_list[i] -= 1
            hight_index_list[i] += 1
            if hight_list[i] in hight_list[i + 1:]:
                index = i + hight_list[i + 1:].index(hight_list[i]) + 1
                puddle_list.append((hight_index_list[i], hight_index_list[index]))
                i = index

    result = [cal_puddle(diagram[s:e]) for s, e in puddle_list]
    print(sum(result))
    print(len(result), " ".join([str(a) for a in result]))
if __name__ == "__main__":
    a = input()
    cal_revision(a)
    #print(sum(result))
    #print(str(len(result)) + "".join([" " + str(a) for a in result]))

### FIXED CODE ###

def cal_puddle(puddle):
    depth = 0
    score = 0
    for s in puddle:
        if s == "\\":
            score += depth + 0.5
            depth += 1
        elif s == "/":
            depth -= 1
            score += depth + 0.5
        elif s == "_":
            score += depth

        if depth == 0:
            return int(score)
    return int(score)

def get_puddles(diagram):
    hight = 0
    top_list = []
    in_puddle = True
    for index, s in enumerate(diagram + "\\"):
        if s == "/":
            in_puddle = True
            hight += 1
        if s == "\\":
            if in_puddle:
                in_puddle = False
                top_list.append([hight, index])
            hight -= 1

    puddles = []
    prev_hight = 0
    hight_list = [h for h, i in top_list]
    i = 0
    while i < len(top_list) - 1:
        cur_top = top_list[i]
        next_tops = list(filter(lambda top:cur_top[0] <= top[0], top_list[i + 1:]))
        #print(next_tops)
        if next_tops:
            next_top = next_tops[0]
            puddles.append((cur_top[1], next_top[1]))
            i = top_list.index(next_top)
        else:
            cur_top[0] -= 1
            cur_top[1] += diagram[cur_top[1] + 1:].index("\\") + 1
    #print(hight_list)
    #print(top_list)
    #print(puddles)
    return puddles

def main():
    diagram = input()
    result = []
    for s,e in get_puddles(diagram):
        result.append(cal_puddle(diagram[s:e]))
    print(sum(result))
    print(str(len(result)) + "".join([" " + str(i) for i in result]))
if __name__ == "__main__":
    main()