# input
section = raw_input()

# map the height of the section
height = 0
heights = [0]
for p in xrange( len(section) ):
    if   section[p] == '/':
        height += 1
    elif section[p] == '\\':
        height -= 1
    heights.append(height)

# search the pools
pools = []
water = []
p = 0
while p < len(section):
    if section[p] == '\\':
        try:
            pr = heights[p+1:].index( heights[p] )
            pools.append([p, p+1+pr])
            p = p+1+pr
        except:
            p+=1
    else:
        p+=1

# count
for pool in pools:
    tp = section[pool[0]:pool[1]]
    depth = 0
    s = 0
    for p in xrange( len(tp) ):
        if   tp[p] == '/':
            depth -= 1
        elif tp[p] == '\\':
            depth += 1
            s += 2*(depth-1)+1
        else:
            s += depth
    water.append(s)

# print
print sum(water)
if len(water) == 0:
    print len(water)
else:
    print len(water), " ".join(map(str, water)) section = raw_input() section raw_input() raw_input height = 0 height 0 heights = [0] heights [0] 0 for p in xrange( len(section) ):
    if   section[p] == '/':
        height += 1
    elif section[p] == '\\':
        height -= 1
    heights.append(height)

# search the pools p xrange( len(section) ) xrange len(section) len section if   section[p] == '/':
        height += 1
    elif section[p] == '\\':
        height -= 1
     section[p] == '/' section[p] section p '/' height += 1 height 1 elif section[p] == '\\':
        height -= 1
     section[p] == '\\' section[p] section p '\\' height -= 1 height 1 heights.append(height) heights.append heights append height pools = [] pools [] water = [] water [] p = 0 p 0 while p < len(section):
    if section[p] == '\\':
        try:
            pr = heights[p+1:].index( heights[p] )
            pools.append([p, p+1+pr])
            p = p+1+pr
        except:
            p+=1
    else:
        p+=1

# count p < len(section) p len(section) len section if section[p] == '\\':
        try:
            pr = heights[p+1:].index( heights[p] )
            pools.append([p, p+1+pr])
            p = p+1+pr
        except:
            p+=1
    else:
        p+=1

# count section[p] == '\\' section[p] section p '\\' try:
            pr = heights[p+1:].index( heights[p] )
            pools.append([p, p+1+pr])
            p = p+1+pr
        except:
            p+=1
     except:
            p+=1
     p+=1 p 1 pr = heights[p+1:].index( heights[p] ) pr heights[p+1:].index( heights[p] ) [p+1:].index [p+1:] heights p+1: p+1 p 1 index heights[p] heights p pools.append([p, p+1+pr]) pools.append pools append [p, p+1+pr] p p+1+pr p+1 p 1 pr p = p+1+pr p p+1+pr p+1 p 1 pr p+=1 p 1 for pool in pools:
    tp = section[pool[0]:pool[1]]
    depth = 0
    s = 0
    for p in xrange( len(tp) ):
        if   tp[p] == '/':
            depth -= 1
        elif tp[p] == '\\':
            depth += 1
            s += 2*(depth-1)+1
        else:
            s += depth
    water.append(s)

# print pool pools tp = section[pool[0]:pool[1]] tp section[pool[0]:pool[1]] section pool[0]:pool[1] pool[0] pool 0 pool[1] pool 1 depth = 0 depth 0 s = 0 s 0 for p in xrange( len(tp) ):
        if   tp[p] == '/':
            depth -= 1
        elif tp[p] == '\\':
            depth += 1
            s += 2*(depth-1)+1
        else:
            s += depth
     p xrange( len(tp) ) xrange len(tp) len tp if   tp[p] == '/':
            depth -= 1
        elif tp[p] == '\\':
            depth += 1
            s += 2*(depth-1)+1
        else:
            s += depth
     tp[p] == '/' tp[p] tp p '/' depth -= 1 depth 1 elif tp[p] == '\\':
            depth += 1
            s += 2*(depth-1)+1
         tp[p] == '\\' tp[p] tp p '\\' depth += 1 depth 1 s += 2*(depth-1)+1 s 2*(depth-1)+1 2*(depth-1) 2 depth-1 depth 1 1 s += depth s depth water.append(s) water.append water append s print sum(water) sum water if len(water) == 0:
    print len(water)
else:
    print len(water), " ".join(map(str, water)) len(water) == 0 len(water) len water 0 print len(water) len water print len(water) len water " ".join(map(str, water)) " ".join " " join map(str, water) map str water s += 2*(depth-1)+1 2*(depth-1)+1 s water = [] [] water height -= 1 1 height p = p+1+pr p+1+pr p pools = [] [] pools p+=1 1 p depth = 0 0 depth depth -= 1 1 depth heights = [0] [0] heights tp = section[pool[0]:pool[1]] section[pool[0]:pool[1]] tp s += depth depth s height += 1 1 height pr = heights[p+1:].index( heights[p] ) heights[p+1:].index( heights[p] ) pr p = 0 0 p p+=1 1 p s = 0 0 s depth += 1 1 depth section = raw_input() raw_input() section height = 0 0 height
# input
section = raw_input()

# map the height of the section
height = 0
heights = [0]
for p in xrange( len(section) ):
    if   section[p] == '/':
        height += 1
    elif section[p] == '\\':
        height -= 1
    heights.append(height)

# search the pools
pools = []
water = []
p = 0
while p < len(section):
    if section[p] == '\\':
        try:
            pr = heights[p+1:].index( heights[p] )
            pools.append([p, p+1+pr])
            p = p+1+pr
        except:
            p+=1
    else:
        p+=1

# count
for pool in pools:
    tp = section[pool[0]:pool[1]]
    depth = 0
    s = 0
    for p in xrange( len(tp) ):
        if   tp[p] == '/':
            depth -= 1
        elif tp[p] == '\\':
            depth += 1
            s += 2*(depth-1)+1
        else:
            s += depth
    water.append(s)

# print
print sum(water)
if len(water) == 0:
    print len(water)
else:
    print len(water), " ".join(map(str, water))