data = input()
#data = '\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\'
diff = {'\\':-1, '_':0, '/':1}
height = [0]
[height.append(height[-1]+diff[i]) for i in data]
bottom = min(height)
height = [h-bottom for h in height]

m = max(height)
water = [m for h in height]

height00 = [0] + height + [0]
water00 = [0] + water + [0]

idx = list(range(1,len(water00)-1))
for i in idx + idx[::-1]:
	water00[i] = max(height00[i],min(water00[i-1:i+2]))

water = water00[1:-1]
depth = [w-h for w,h in zip(water,height)]

paddles = [0]
for d1,d2 in zip(depth[:-1],depth[1:]):
	if d1==0 and d2>0:
		paddles.append(0)
	paddles[-1] += min(d1,d2) + 0.5*abs(d1-d2)

paddles = [int(p) for p in paddles[1:]]
print(sum(paddles))
print(len(paddles), *paddles) data = input() data input() input diff = {'\\':-1, '_':0, '/':1} diff {'\\':-1, '_':0, '/':1} '\\' '\\' -1 '_' '_' 0 '/' '/' 1 height = [0] height [0] 0 height.append(height[-1]+diff[i]) for i in data for i in data i data for i in data height.append(height[-1]+diff[i]) height.append height append height[-1]+diff[i] height[-1] height -1 diff[i] diff i [height.append(height[-1]+diff[i]) for i in data] bottom = min(height) bottom min(height) min height h-bottom for h in height for h in height h height for h in height h-bottom h bottom height = [h-bottom for h in height] height [h-bottom for h in height] m = max(height) m max(height) max height m for h in height for h in height h height for h in height m water = [m for h in height] water [m for h in height] height00 = [0] + height + [0] height00 [0] + height + [0] [0] + height [0] 0 height [0] 0 water00 = [0] + water + [0] water00 [0] + water + [0] [0] + water [0] 0 water [0] 0 idx = list(range(1,len(water00)-1)) idx list(range(1,len(water00)-1)) list range(1,len(water00)-1) range 1 len(water00)-1 len(water00) len water00 1 for i in idx + idx[::-1]:
	water00[i] = max(height00[i],min(water00[i-1:i+2])) i idx + idx[::-1] idx idx[::-1] idx ::-1 -1 water00[i] = max(height00[i],min(water00[i-1:i+2])) water00[i] water00 i max(height00[i],min(water00[i-1:i+2])) max height00[i] height00 i min(water00[i-1:i+2]) min water00[i-1:i+2] water00 i-1:i+2 i-1 i 1 i+2 i 2 water = water00[1:-1] water water00[1:-1] water00 1:-1 1 -1 w-h for w,h in zip(water,height) for w,h in zip(water,height) w h zip(water,height) zip water height for w,h in zip(water,height) w-h w h depth = [w-h for w,h in zip(water,height)] depth [w-h for w,h in zip(water,height)] paddles = [0] paddles [0] 0 for d1,d2 in zip(depth[:-1],depth[1:]):
	if d1==0 and d2>0:
		paddles.append(0)
	paddles[-1] += min(d1,d2) + 0.5*abs(d1-d2) d1 d2 zip(depth[:-1],depth[1:]) zip depth[:-1] depth :-1 -1 depth[1:] depth 1: 1 if d1==0 and d2>0:
		paddles.append(0)
	 d1==0 and d2>0 d1==0 d1 0 d2>0 d2 0 paddles.append(0) paddles.append paddles append 0 paddles[-1] += min(d1,d2) + 0.5*abs(d1-d2) paddles[-1] paddles -1 min(d1,d2) + 0.5*abs(d1-d2) min(d1,d2) min d1 d2 0.5*abs(d1-d2) 0.5 abs(d1-d2) abs d1-d2 d1 d2 int(p) for p in paddles[1:] for p in paddles[1:] p paddles[1:] paddles 1: 1 for p in paddles[1:] int(p) int p paddles = [int(p) for p in paddles[1:]] paddles [int(p) for p in paddles[1:]] print(sum(paddles)) print sum(paddles) sum paddles print(len(paddles), *paddles) print len(paddles) len paddles *paddles paddles water = [m for h in height] [m for h in height] water bottom = min(height) min(height) bottom depth = [w-h for w,h in zip(water,height)] [w-h for w,h in zip(water,height)] depth water = water00[1:-1] water00[1:-1] water water00 = [0] + water + [0] [0] + water + [0] water00 paddles = [int(p) for p in paddles[1:]] [int(p) for p in paddles[1:]] paddles paddles = [0] [0] paddles height00 = [0] + height + [0] [0] + height + [0] height00 idx = list(range(1,len(water00)-1)) list(range(1,len(water00)-1)) idx height = [h-bottom for h in height] [h-bottom for h in height] height data = input() input() data m = max(height) max(height) m height = [0] [0] height diff = {'\\':-1, '_':0, '/':1} {'\\':-1, '_':0, '/':1} diff
data = input()
#data = '\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\'
diff = {'\\':-1, '_':0, '/':1}
height = [0]
[height.append(height[-1]+diff[i]) for i in data]
bottom = min(height)
height = [h-bottom for h in height]

m = max(height)
water = [m for h in height]

height00 = [0] + height + [0]
water00 = [0] + water + [0]

idx = list(range(1,len(water00)-1))
for i in idx + idx[::-1]:
	water00[i] = max(height00[i],min(water00[i-1:i+2]))

water = water00[1:-1]
depth = [w-h for w,h in zip(water,height)]

paddles = [0]
for d1,d2 in zip(depth[:-1],depth[1:]):
	if d1==0 and d2>0:
		paddles.append(0)
	paddles[-1] += min(d1,d2) + 0.5*abs(d1-d2)

paddles = [int(p) for p in paddles[1:]]
print(sum(paddles))
print(len(paddles), *paddles)