class Pond:
    def __init__(self, down_x, area):
        super().__init__()
        self.down_x = down_x
        self.area = area


s = []
ponds = []
all_area = 0
x = 0
for c in input():
    if "\\" == c:
        s.append(x)
    elif "/" == c and s:
        down_x = s.pop()
        area = x - down_x
        all_area += area
        while ponds and ponds[-1].down_x > down_x:
            area += ponds[-1].area
            ponds.pop()
        ponds.append(Pond(down_x, area))
    x += 1
print(all_area)
if ponds:
    print(len(ponds), ' '.join(map(lambda pond: str(pond.area), ponds)))
else:
    print(0)
 class Pond:
    def __init__(self, down_x, area):
        super().__init__()
        self.down_x = down_x
        self.area = area Pond def __init__(self, down_x, area):
        super().__init__()
        self.down_x = down_x
        self.area = area __init__ super().__init__() ().__init__ () super __init__ self.down_x = down_x self.down_x self down_x down_x self.area = area self.area self area area self self down_x down_x area area s = [] s [] ponds = [] ponds [] all_area = 0 all_area 0 x = 0 x 0 for c in input():
    if "\\" == c:
        s.append(x)
    elif "/" == c and s:
        down_x = s.pop()
        area = x - down_x
        all_area += area
        while ponds and ponds[-1].down_x > down_x:
            area += ponds[-1].area
            ponds.pop()
        ponds.append(Pond(down_x, area))
    x += 1 c input() input if "\\" == c:
        s.append(x)
    elif "/" == c and s:
        down_x = s.pop()
        area = x - down_x
        all_area += area
        while ponds and ponds[-1].down_x > down_x:
            area += ponds[-1].area
            ponds.pop()
        ponds.append(Pond(down_x, area))
     "\\" == c "\\" c s.append(x) s.append s append x elif "/" == c and s:
        down_x = s.pop()
        area = x - down_x
        all_area += area
        while ponds and ponds[-1].down_x > down_x:
            area += ponds[-1].area
            ponds.pop()
        ponds.append(Pond(down_x, area))
     "/" == c and s "/" == c "/" c s down_x = s.pop() down_x s.pop() s.pop s pop area = x - down_x area x - down_x x down_x all_area += area all_area area while ponds and ponds[-1].down_x > down_x:
            area += ponds[-1].area
            ponds.pop()
         ponds and ponds[-1].down_x > down_x ponds ponds[-1].down_x > down_x ponds[-1].down_x [-1] ponds -1 down_x down_x area += ponds[-1].area area ponds[-1].area [-1] ponds -1 area ponds.pop() ponds.pop ponds pop ponds.append(Pond(down_x, area)) ponds.append ponds append Pond(down_x, area) Pond down_x area x += 1 x 1 print(all_area) print all_area if ponds:
    print(len(ponds), ' '.join(map(lambda pond: str(pond.area), ponds)))
else:
    print(0) ponds print(len(ponds), ' '.join(map(lambda pond: str(pond.area), ponds))) print len(ponds) len ponds ' '.join(map(lambda pond: str(pond.area), ponds)) ' '.join ' ' join map(lambda pond: str(pond.area), ponds) map lambda pond: str(pond.area) str(pond.area) str pond.area pond area pond ponds print(0) print 0 x = 0 0 x area += ponds[-1].area ponds[-1].area area class Pond:
    def __init__(self, down_x, area):
        super().__init__()
        self.down_x = down_x
        self.area = area class Pond:
    def __init__(self, down_x, area):
        super().__init__()
        self.down_x = down_x
        self.area = area Pond all_area += area area all_area x += 1 1 x all_area = 0 0 all_area ponds = [] [] ponds down_x = s.pop() s.pop() down_x s = [] [] s area = x - down_x x - down_x area
class Pond:
    def __init__(self, down_x, area):
        super().__init__()
        self.down_x = down_x
        self.area = area


s = []
ponds = []
all_area = 0
x = 0
for c in input():
    if "\\" == c:
        s.append(x)
    elif "/" == c and s:
        down_x = s.pop()
        area = x - down_x
        all_area += area
        while ponds and ponds[-1].down_x > down_x:
            area += ponds[-1].area
            ponds.pop()
        ponds.append(Pond(down_x, area))
    x += 1
print(all_area)
if ponds:
    print(len(ponds), ' '.join(map(lambda pond: str(pond.area), ponds)))
else:
    print(0)

