sectional_view = input()

list_index_down = []
list_index_area_left = []
list_area = []


for index_now, mark in enumerate(sectional_view):
    if   mark == "\\":
        list_index_down += [index_now]
    elif mark == "/" and list_index_down:
        index_down_last = list_index_down.pop()
        area = index_now - index_down_last

        while ((list_index_area_left) and
               (list_index_area_left[-1] > index_down_last)):
            area += list_area.pop()
            list_index_area_left.pop()

        list_index_area_left.append(index_down_last)
        list_area.append(area)


print(sum(list_area))
print(len(list_area),*(list_area))
 sectional_view = input() sectional_view input() input list_index_down = [] list_index_down [] list_index_area_left = [] list_index_area_left [] list_area = [] list_area [] for index_now, mark in enumerate(sectional_view):
    if   mark == "\\":
        list_index_down += [index_now]
    elif mark == "/" and list_index_down:
        index_down_last = list_index_down.pop()
        area = index_now - index_down_last

        while ((list_index_area_left) and
               (list_index_area_left[-1] > index_down_last)):
            area += list_area.pop()
            list_index_area_left.pop()

        list_index_area_left.append(index_down_last)
        list_area.append(area) index_now mark enumerate(sectional_view) enumerate sectional_view if   mark == "\\":
        list_index_down += [index_now]
    elif mark == "/" and list_index_down:
        index_down_last = list_index_down.pop()
        area = index_now - index_down_last

        while ((list_index_area_left) and
               (list_index_area_left[-1] > index_down_last)):
            area += list_area.pop()
            list_index_area_left.pop()

        list_index_area_left.append(index_down_last)
        list_area.append(area) mark == "\\" mark "\\" list_index_down += [index_now] list_index_down [index_now] index_now elif mark == "/" and list_index_down:
        index_down_last = list_index_down.pop()
        area = index_now - index_down_last

        while ((list_index_area_left) and
               (list_index_area_left[-1] > index_down_last)):
            area += list_area.pop()
            list_index_area_left.pop()

        list_index_area_left.append(index_down_last)
        list_area.append(area) mark == "/" and list_index_down mark == "/" mark "/" list_index_down index_down_last = list_index_down.pop() index_down_last list_index_down.pop() list_index_down.pop list_index_down pop area = index_now - index_down_last area index_now - index_down_last index_now index_down_last while ((list_index_area_left) and
               (list_index_area_left[-1] > index_down_last)):
            area += list_area.pop()
            list_index_area_left.pop()

         (list_index_area_left) and
               (list_index_area_left[-1] > index_down_last) list_index_area_left list_index_area_left[-1] > index_down_last list_index_area_left[-1] list_index_area_left -1 index_down_last area += list_area.pop() area list_area.pop() list_area.pop list_area pop list_index_area_left.pop() list_index_area_left.pop list_index_area_left pop list_index_area_left.append(index_down_last) list_index_area_left.append list_index_area_left append index_down_last list_area.append(area) list_area.append list_area append area print(sum(list_area)) print sum(list_area) sum list_area print(len(list_area),*(list_area)) print len(list_area) len list_area *(list_area) list_area sectional_view = input() input() sectional_view list_index_down = [] [] list_index_down list_area = [] [] list_area area = index_now - index_down_last index_now - index_down_last area area += list_area.pop() list_area.pop() area list_index_down += [index_now] [index_now] list_index_down list_index_area_left = [] [] list_index_area_left index_down_last = list_index_down.pop() list_index_down.pop() index_down_last
sectional_view = input()

list_index_down = []
list_index_area_left = []
list_area = []


for index_now, mark in enumerate(sectional_view):
    if   mark == "\\":
        list_index_down += [index_now]
    elif mark == "/" and list_index_down:
        index_down_last = list_index_down.pop()
        area = index_now - index_down_last

        while ((list_index_area_left) and
               (list_index_area_left[-1] > index_down_last)):
            area += list_area.pop()
            list_index_area_left.pop()

        list_index_area_left.append(index_down_last)
        list_area.append(area)


print(sum(list_area))
print(len(list_area),*(list_area))

